A food delivery driver accused of shooting at the US embassy in Beirut last week had a grudge against guards at the compound, Lebanese police have said.
A Lebanese man suspected of firing the shots was arrested on Monday.
On Thursday, police said the man, who was identified by his initials MK, had confessed to the shooting.
They said he admitted he had been upset, claiming guards had insulted him two months earlier when he delivered food to the compound.
No one was hurt in the shooting in Beirut’s north-eastern Christian suburb of Aukar, which left at least five bullet holes in the wall next to the embassy entrance.
Police said that during the arrest, security forces confiscated an AK-47 rifle, a knife and the suspect's food delivery motorcycle. The rifle was allegedly hidden in a food delivery bag.
According to police, the suspect changed his route to reach the US embassy compound, avoid Lebanese Army checkpoints on the main road.
There is a long history of attacks against Americans in Lebanon.
The deadliest incident took place in October 1983, when a suicide truck bomber drove into a four-storey building at the US Marine barracks at Beirut Airport, killing 241 American service members.
In April 1983, a bombing attack on the US embassy killed 63 people, including at least 17 Americans. Top CIA officials were among those who died.
US officials blamed the Iran-backed Lebanese militant group Hezbollah. After that attack, the embassy was moved from central Beirut to Aukar.
In September 1984, a suicide bomber attacked the embassy compound in Aukar, killing 14 people and leading to the closure of the embassy.
The US withdrew all diplomats from Beirut in September 1989 and did not reopen its embassy until 1991.
In 2008, an explosion targeted a US embassy vehicle in northern Beirut, killing at least three Lebanese who happened to be near the car and wounding its Lebanese driver. An American passerby was also wounded.
In 1984, William Buckley, the CIA station chief in Beirut, was abducted and subsequently killed by the Iran-backed Islamic Jihad group.
In 1976, US ambassador Francis Meloy, aide Robert Waring and their driver were abducted and killed in Beirut.