The president of the UAE on Saturday issued a law implementing compulsory military service for Emirati men, a move highlighting the Gulf state's concern over turmoil in the region.

The UAE, a federation of seven emirates with a mostly expatriate population, faces no immediate threats from neighbours and has been spared militant attacks that have targeted other countries like Saudi Arabia.

Like other Gulf Arab states, the US ally has strong military ties with Western powers that say they are committed to helping the OPEC member country deter or repel any threat.

But the UAE, a big buyer of Western military hardware, has a territorial dispute with its much bigger neighbor, Iran, over three Gulf islands controlled by the Islamic republic.

It is also wary of a neighbourhood fraught with conflicts, including in Syria, Iraq and Israel and the Palestinian territories.

The state WAM news agency said President Sheikh Khalifa bin Zayed Al Nahyan had issued the federal law, which was published in the official gazette. The UAE had first said in January that it would introduce the law.

"The issuing of the law comes with the goals of affirming the instilling of the values of loyalty, affiliation and sacrifice in the souls of the sons of homeland," WAM said.

The law applies to all males between the ages of 18 and 30 and in good medical health. Men who have a high school degree or its equivalent will serve nine months, while those who do not have a high school diploma will serve for two years, WAM said.

Participation for women, who can only serve for nine months, is optional and will require the approval of their legal guardians.

Military service will include training periods, military exercises and lectures on patriotism and security, WAM said, citing the law.

The London-based International Institute for Strategic Studies estimates the size of the UAE armed forces at 51,000, with an army of 44,000, navy of 2,500 and air force of 4,500.