The man who killed four people outside Britain's Parliament was in Saudi Arabia three times and taught English there, the Middle Eastern country's embassy said.

A Saudi Embassy statement released late Friday said that Khalid Masood taught English in Saudi Arabia from November 2005 to November 2006 and again from April 2008 to April 2009.

The embassy said that he had a work visa. It said he returned for six days in March 2015 on a trip booked through an approved travel agent.

The Saudi Embassy said that he wasn't tracked by the country's security services and didn't have a criminal record there.

Before taking the name Masood, he was known as Adrian Elms. He was known for having a violent temper in England and had been convicted at least twice for violent crimes.

Masood drove his rented SUV across the crowded Westminster Bridge on Wednesday, striking pedestrians. Then he jumped out and attacked police officer Keith Palmer, who was guarding Parliament, fatally stabbing him before being shot dead by police.

In all, he killed four people and left more than two dozen hospitalized, including some with what have been described as catastrophic injuries. The Islamic State group claimed responsibility for the attack.

Masood, who at 52 is considerably older than most extremists who carry out bloodshed in the West, had an arrest record dating to 1983. The violence came later, first in 2000 when he slashed a man across the face in a pub parking lot in a racially charged argument after drinking four pints, according to a newspaper account.

Hundreds of British police have been working to determine his motives and possible accomplices. Two people remain in custody for questioning. They are two men, aged 27 and 58, who were arrested in the central English city of Birmingham, where Masood was living. Authorities haven't charged or identified the two men. Others who were arrested in connection with the investigation have been released.

Details about how he became radicalized aren't clear. His time in Saudi Arabia may provide clues. He was also jailed in Britain and may have become exposed to radical views while an inmate.

Masood's last conviction was in 2003, also involving a knife attack. It's not clear when he took the name Masood, suggesting a conversion to Islam.