An explosive, eight-hour shootout in west Beirut that apparently erupted after a domestic dispute killed at least two people early Thursday, including a gunman who was firing machine guns and lobbing grenades from his balcony.

An officer and four soldiers were wounded in the gunbattle, which began Wednesday night in the residential Caracas neighborhood, the army said in statement.

Lebanese troops stormed an apartment around 6 a.m., killing one gunman and wounding another, an Associated Press reporter at the scene said. Inside the apartment, authorities also found the corpse of a third gunman along with weapons, ammunition, hand grenades and other military equipment, the army statement said.

Lebanon has dozens of armed militias that grew out of the country's 15-year civil war and still flourish 22 years after the conflict ended, and an alarming number of private individuals hold weapons in their homes, including hunting rifles, guns and even RPGs.

The abundance of weapons is one reason why conflicts here can turn deadly so quickly.

The shootout comes at a time of heightened tensions in Lebanon, where deadly clashes linked to the conflict in neighboring Syria have killed at least 10 people in the past two weeks.

Lebanese security officials said at least one of the gunmen was Syrian. But residents and police officials speaking on condition of anonymity said Thursday's shooting started with a personal dispute between a couple. According to residents in the area, one of the gunmen was distraught because his girlfriend was breaking up with him.

The girlfriend was believed to have escaped.

During the standoff, a man lobbing grenades at the army from the apartment shouted "Allahu Akbar" and "You will never get inside my apartment!"

An army statement issued Thursday did not give a reason for the shootout, but said the soldiers came under fire from gunmen holed up in a seventh floor apartment.

The men ignored repeated warnings to turn themselves in, and fired machine guns and hurled hand grenades at the soldiers surrounding the building.

One of the gunmen apparently was killed early on in the fighting, apparently shot by one of the other men in the apartment. The remaining gunman kept firing at the soldiers for hours, until the army was able to storm the building.

The standoff caused panic in west Beirut among residents still reeling from deadly clashes between pro- and anti-Syrian groups in the capital early Monday, which killed two people.

Syria and Lebanon share a complex web of political and sectarian ties and rivalries, often causing events on one side of the border to echo on the other.

The arrest earlier this month of an outspoken Lebanese critic of Syria led to gunbattles in the northern Lebanese city of Tripoli that killed at least eight people and wounded many more.