DUBAI (Reuters) - Gunfire broke out along the Iraq-Kuwait border on Monday, sources from both sides said, in the latest sign of localized tensions over the position of the frontier that remain more than two decades after Saddam Hussein's invasion.

Kuwaiti media said shots were fired from the Iraqi side of the frontier, aimed at members of a border demarcation team working inside Kuwait.

Iraqi police gave a different account, saying officers had fired into the air to break up a demonstration inside Iraq by locals unhappy about the position of the boundary.

Both countries agreed to map out the exact position of their shared border after the first Gulf War - when Iraqi dictator Hussein invaded Kuwait in 1990 and was forced out by a U.S.-led coalition.

Iraq formally accepted a U.N.-demarcated border line in 1994. But many Iraqis in the area remain opposed to it, saying they lost homes and territory.

Kuwaiti news website Al-Aan quoted a security source saying an exchange of fire broke out on Monday after Iraqis hurled stones at Kuwaitis doing maintenance work on border posts.

Kuwait withdrew the border demarcation team after the shooting "to calm the situation," the country's Al-Rai newspaper reported in a brief story.

State news agency KUNA said Iraqis in the border area had "sabotaged" the border fence and "obstructed U.N.-supervised border signs maintenance," but did not mention any shooting.

Kuwait called on Iraqi security authorities to put an end to such actions, KUNA said, citing an anonymous foreign ministry official.

Iraqi police sources in Um Qasr, near the border, said some officers had fired in the air to disperse demonstrators who had thrown stones at them during a protest against the demarcation.

Leaders from both countries have been working to improve diplomatic ties in the past year despite ongoing public wariness.

The Middle East neighbors came to an agreement over Gulf War-era debts last year. Kuwait's ruler and Iraq's prime minister have also visited each other's countries.