* Police say they acted against "armed group" planning attacks
* Violence deepens political crisis, re-awakes ethnic tension
* NATO calls for "transparent investigation" (Updates with damage, paragraphs 4-5)
By Matt Robinson and Fatos Bytyci
KUMANOVO, Macedonia, May 10 (Reuters) - Macedonia said on Sunday its police had wiped out a group of ethnic Albanian "terrorists" in a day-long gun battle that left at least 22 people dead at a moment of deep political crisis in the former Yugoslav republic.
NATO, which dragged Macedonia from the brink of civil war in 2001, called for a "transparent investigation" of what went on when heavily armed police entered a mainly Albanian neighbourhood in the northern town of Kumanovo before dawn on Saturday.
The government said eight police and 14 members of an "armed group" had been killed in the ensuing gun battle, describing the gunmen as former rebel commanders from neighbouring Kosovo, which broke from Serbia in war in 1999 and inspired an ethnic Albanian insurgency in Macedonia two years later.
A Reuters reporter saw residents returning after dark, scurrying to their homes through streets stained with blood. At least eight houses were damaged beyond repair, flames still licking the roof of one.
"It's total destruction. Thank God we're safe," said Haki Ukshini, his home reduced to a brick shell shorn of roof and windows.
Police said the gunmen had been plotting to attack civilian and state targets this month, just as a political crisis rocking the government threatens to climax in an opposition rally called for May 17.
Explosions and automatic gunfire rattled Kumanovo through Saturday and into Sunday, recalling the clashes of 2001.
Then, NATO brokered a peace deal and some of the ethnic Albanian guerrillas entered government. But tensions remain, fuelled by poverty, isolation and the glacial pace of integration with the West.
NATO Secretary-General Jens Stoltenberg called for calm and a "transparent investigation to establish what happened".
Conservative Prime Minister Nikola Gruevski, whose nine-year hold on power has been threatened by allegations of illegal wire-tapping and abuse of power levelled by opposition leader Zoran Zaev, suggested some of those killed or arrested in Kumanovo had fought "in the Middle East".
"This is not a Macedonian-Albanian conflict, but a conflict between people who mean no good to the state and people who uphold the state," he said in a live televised address after police declared the operation over.
Dozens of people were arrested, some of them taken to court handcuffed and in white jump-suits.
An estimated 30 percent of Macedonia's 2 million people are ethnic Albanians. In Kumanovo, they poured scorn on the official version of events.
"This is pure manipulation," said 40-year-old Elham Murad, an unemployed Albanian man who had fled his home in the besieged suburb. He said he had seen nothing unusual in the days leading up to the police operation, except for a drone aircraft flying above the town the day before.
"This is a stunt by Gruevski to cover up Zaev's revelations," he said. Asked if he would attend the May 17 protest, Murad replied: "I'll go, dead or alive."
Ambassadors of the United States, European Union, OSCE and NATO issued a joint statement saying they hoped the drama would prompt leaders "to pull together and engage in dialogue on all issues facing the country, including the protracted political crisis".
Macedonia's bid to join NATO and the EU, seen in the Balkans as a promise of jobs, prosperity and freedom of movement, is blocked by a long-running dispute with Greece over the country's name.
An Interior Ministry spokesman, Ivo Kotevski, said 37 police officers had been wounded in the clashes, and did not rule out that the death toll might rise. Two were buried in the western region of Tetovo, their coffins draped in the Macedonian flag and escorted by uniformed colleagues. (Additional reporting by Kole Casule in Skopje; Writing by Matt Robinson; Editing by Tom Heneghan and Kevin Liffey)