Tens of thousands of pounds have been raised by the UK public in memory of police officer Keith Palmer, who was fatally stabbed by an attacker outside the Houses of Parliament on Wednesday.

Almost £200,000 has been donated after the Metropolitan Police Federation launched the memorial fund to pay tribute to their “fallen colleague”, who they say was “simply doing his job” when he was senselessly targeted while guarding the Palace of Westminster.

The JustGiving page, launched just after 9am on Thursday, reached its target of £10,000 in less than two hours, and has seen donations and messages of condolences pouring in every few minutes. It's new target is £250,000.

Mr Palmer, 48, was stabbed after the attacker had carried out a deadly rampage across Westminster Bridge, during which he mounted the pavement and ploughed his 4x4 into pedestrians, killing two and injuring dozens of others.

The officer, also a husband and father, was operated on at the scene before an ambulance helicopter arrived, but was later pronounced dead in hospital.

The Metropolitan Police Federation wrote on the JustGiving page: “[We] are raising money for the family of PC Keith Palmer, the Police Officer who tragically gave his life on 22 March 2017 as he guarded the Palace of Westminster from what is believed to have been a terrorist attack.”

Ken Marsh, chairman of the federation, meanwhile said: “The entire police family is in mourning at his death, and this memorial fund enables people to donate in Keith's memory. He was simply doing his job.”

The page states that the family of Mr Palmer will decide how the fund will be spent.

Along with the influx of donations, messages have been posted on the page for the officer's family and colleagues.

One woman, Susan Dewitt, wrote: “So very sorry for your loss. A very brave man. All the country are so proud of his actions yet totally saddened by his untimely loss.”

A police officer places flowers and a photo of PC Keith Palmer on Whitehall near the Houses of Parliament (PA)

Another, Wendy Revitt, said: “God bless to a very brave man, such a tragic loss our thoughts are with his, family, friends and colleagues. A big thank you to all of our Police force who provide a gallant service everyday to us all in Great Britain.”

A separate GoFundMe page set up independently by a Metropolitan Police officer on Wednesday has meanwhile raised more than £4,000.

PC Martin Coughlan, who created the page, said all funds raised would go to the officer’s next of kin, who he said was yet to be identified by the police force.

“An officer fell in the line of duty today. The weeks ahead are going to be taxing for his family and colleagues who survive him,” wrote Mr Coughlan.

“Please help to support his family in any way you can. All funds raised will be donated to Keith's next of kin. His next of kin will be identified via his line manager at work.