Sadiq Khan issued a video statement, vowing "Londoners will never be cowed by terrorism."
At least four people have died after a knifeman mowed down pedestrians on Westminster Bridge then stabbed a policeman in front of Parliament before being shot by armed officers.
He said: “Today London suffered a horrific attack near Parliament Square which we are treating as a terror attack.
“A number of people have lost their lives and at least twenty people have been injured.
Londoners will never be cowed by terrorism
“My heart goes out to those who have lost loved ones and to everyone who has been affected.
“Tragically, a Metropolitan Police officer who was doing his duty protecting out city is amongst those who have been killed and my thoughts are with his family this evening.
“I want to express my gratitude, on behalf of all Londoners, to the police and emergency services who have shown tremendous bravery in exceptionally difficult circumstances.
“I have spoken to the Acting Commissioner Metropolitan Police Commissioner Craig Mackay and national lead for Counter-Terrorism Policing and Acting Deputy Commissioner Mark Rowley and remain in close contact with them.
London terror attack: Mayor Sadiq Khan vowed Londoners "will not be cowed by terrorism"
“Londoners should be aware that there will be additional armed and unarmed police officers on our streets from tonight in order to keep Londoners, and all those visiting out city safe.
“I want to reassure all Londoners, and all our visitors, not to be alarmed. Our city remains one of the safest in the world.
Get Quotes on Home Insurance
“London is the greatest city in the world and we stand together in the face of those who seek to harm us and destroy our way of life.
“We always have and we always will. Londoners will never be cowed by terrorism.”
Hours earlier the Mayor was criticised for his "deafneing silence" after issuing a brief statement before Scotland Yard confirmed the fatalities in today’s atrocity.
Scotland Yard confirmed the deaths shortly before 6pm, but Mr Khan’s office remained silent until 7.30pm pointing to their earlier statement made hours earlier.
London Terror Attack: LIVE PICTURES Wed, March 22, 2017
Two dead, 12 injured as knifeman mows into crowd in Westminster
PA 1 of 36
Conservative MP Tobias Ellwood (centre) helps emergency services attend to a police officer outside the Palace of Westminster, London
At 4.26pm Sadiq Khan issued a statement saying: "There has been a serious incident near to Parliament Square this afternoon which is being treated as a terrorist attack until the police know otherwise.
“I have spoken to the Acting Commissioner. The Metropolitan Police Service is dealing with the incident and an urgent investigation is underway. My thoughts are with those affected and their families.
“I would like to express my thanks to the police and emergency services who work so hard to keep us safe and show tremendous bravery in exceptionally difficult circumstances."
But shocked Londoners used Twitter to ask why their Mayor had not responded to the attack earlier.
@cat_leslee said: “The silence of @SadiqKhan is deafening. No comment Mr Mayor!”
Katie Hopkins said: “Sadiq Kahn't. If you are penning some naff missive about a proud city, standing together, united by shared values, think again son.”
Katie Hopkins lashed out at Sadiq Khan
One Twitter user branded Mr Khan's "silence deafening"
Londoners asked where Mr Khan was as the city responded to the attack
Donald Trump Jnr unleashed a rant against the London Mayor
@RaineFalls_ said: “Where the f*** has our Mayor @SadiqKhan been since the Westminster attack? All we get is a short s****y note. Where is the moron?”
Donald Trump Junior has also launched a rant against Mr Khan as his father US president Donald Trump called Prime Minister Theresa May to offer US support in the wake of the attack.
Mr Trump Jnr dug out an old Evening Standard article which quoted Mr Khan as saying terror attacks are “part and parcel of living in a big city” and encouraged Londers to be vigilant.
Tweeting a link to the article, Mr Trump Jnr said: “You have to be kidding me?!: Terror attacks are part of living in big city, says London Mayor Sadiq Khan”.