The last message left by the killer Khalid Masood on the WhatsApp messaging service, revealing his motivation for the lethal attack in Westminster, has been uncovered by the security agencies, according to The Independent.

In the message, sent just minutes before he began the rampage in which five people died and 50 were injured, the 52-year-old Muslim convert had declared that he was waging jihad in revenge against Western military action in Muslim countries in the Middle East.

The person who received the message has been extensively questioned, but freed after the police and MI5 concluded that he was not part of a plot and had no prior knowledge of what was unfolding on 22 March.

Eleven others detained following the attack were freed and have been cleared from inquiries.

The continuing threat in centre of the capital and heart of the government was highlighted just today with the arrest of a man allegedly carrying what was described as “rucksack of knives” close to the Treasury.

The suspect was taken away by armed police; no one was injured during the incident.

The accessing of Masood’s message was achieved by what has been described by security sources as a use of “human and technical intelligence”.

Details of the method used cannot be disclosed for security reasons, but sources said they now have the technical expertise to repeat the process in future.

It was made possible because Masood’s mobile telephone was recovered after he was shot dead.

Discovering Masood’s last recorded thoughts was the key part of the investigation into what lay behind the assault which started with him mowing down people on the road with a rented car and then stabbing a police officer, Keith Palmer, dead on the grounds of the House of Commons.

Scotland Yard stated at the outset that his communications on the day of the attack was the main line of inquiry.

Deputy Assistant Commissioner Neil Basu stressed in an appeal: “If you heard from him on 22 March, please come forward now. The information you have may prove important to establishing his state of mind.”

There was initial thought among investigators that Masood may have been in contact with someone involved in a plotting his attack.

There have been repeated recent atrocities – two in France and two in Germany just in the past year – in which terrorists were found to have been guided through messaging service by Isis “handlers” just before they struck.

Isis had claimed “credit” for the Westminster attack, but no evidence has emerged to back this up.

Masood, who was born in Kent, had come to the notice of the security service for being on the fringes of Islamist extremism in the past, but he was not seen as a threat.

It is suspected that he may have been radicalised during spells in prison in this country and three trips to Saudi Arabia. But it is not known at what point he decided to turn to violence.

Investigators have established that he carried out a reconnaissance journey to central London four days before the attack; he did not discuss the trip with anyone else.

It is unclear when Home Secretary Amber Rudd was made aware that Masood’s WhatsApp message had been retrieved.

She complained soon after the killings that the law agencies had been unable to access Masood’s words because of the use of encryption by the technology company.

She said: “It’s completely unacceptable. There should be no place for terrorists to hide. We need to make sure that organisations like WhatsApp, and there are plenty of others like that, don’t provide a secret place for terrorists to communicate with each other.”

The Home Secretary subsequently urged, at a meeting with her EU counterparts in Brussels, swift action to tackle online access for terrorists and held a meeting later that week in London with technology companies on the same issue.

The secrecy provided to users by social media companies has become a contentious issue after a series of cases in which the sites were used by terrorists and their accomplices.

Michael Adebowale, one of the murderers of Fusilier Lee Rigby, had used Facebook to describe in a graphic way how he wanted to kill a soldier, but Facebook failed to pass this on to the authorities.

Following criticism from the parliamentary intelligence and security committee a spokesman for Facebook said they “do not allow terrorist content on the site and take steps to prevent people from using our service for these purposes”.

Families of victims of terrorism in Brussels, Paris and California are taking legal actions in American courts against Twitter and Facebook claiming that the companies had failed to stop violent extremists from using their platforms.

But civil liberties campaigners, social media firms and technology analysts hold that measures like encryption were essential not just to prevent unwarranted state prying into lives of people but also to ensure that hackers and criminals are prevented from gaining access to personal information.