Michael Zehaf-Bibeau, the gunman behind Wednesday's shooting in Ottawa, had applied to renew his Libyan passport but was denied, CBC News has learned.

Zehaf-Bibeau shot and killed Cpl. Nathan Cirillo at the National War Memorial in Ottawa Wednesday before attacking Parliament Hill.

Zehaf-Bibeau, whose father is Libyan, applied for the passport renewal on Oct. 2 and was refused the same day, the CBC's Evan Dyer reported. The chargé d'affaires at the Libyan Embassy in Ottawa told CBC News he presented a B.C. driver's licence with a Vancouver address. He did not present a Canadian passport.

Zehaf-Bibeau had received a Libyan passport in 2000 and then travelled to the country in 2007. That document had expired, and Zehaf-Bibeau told officials that he wanted a new passport so he could visit family and friends in Libya.

The Libyan official said Zehaf-Bibeau was polite but that his demeanour seemed off. They were also concerned that his photos didn't seem to match his appearance, or the photos of him in his Libyan documents.

Officials also questioned why Zehaf-Bibeau's old Libyan passport gave his first name as Abdul but his driver's licence listed him as Michael.

Zehaf-Bibeau provided his mother's contact information, but there was no answer when officials called the number, and officials weren't satisfied with his answers when they questioned him about his parents' relationship.

The embassy was also puzzled as to why Zehaf-Bibeau had travelled across the country to apply in person.

"Most Libyans who live outside Ottawa apply online," said chargé d'affaires Yousef Furgani, 

Zehaf-Bibeau was warned the embassy would have to look into his background and that it would take at least three weeks to a month. At that point, Zehaf-Bibeau cancelled the application.

RCMP Commissioner Bob Paulson said Thursday that Zehaf-Bibeau was in the process of applying for a Canadian passport when he shot Cirillo.