Updated

A 27-year-old man who was arrested while carrying knives near the U.K. Parliament nearly two weeks ago has been charged with three offenses.

Khalid Mohamed Omar Ali was charged Tuesday with preparation of terrorist acts and unlawful possession of explosive substances.

Counterterrorism officers took Ali into custody on April 27 when he was spotted near Parliament and the prime minister's Downing Street office. Authorities said he had been under surveillance and had large knives in a backpack when he was detained.

London police say he faces two charges of illegal explosive possession related to activity in Afghanistan in 2012 and one charge of preparing terrorist acts "on or before" April 27.

He is scheduled to appear at Westminster Magistrates Court in London on Wednesday.