(Corrects Thaksin's age to 64, not 65)
* Coup blueprint shows junta how to rule "in neutral manner"
* Junta denies planning coup in advance
* May 15 attack on protesters at monument was a coup trigger
* Army rounding up "red shirt" leaders in the north
* Leaders made to sign pledge against "political agitation"
By Amy Sawitta Lefevre and Aubrey Belford
BANGKOK/CHIANG MAI, Thailand, May 30 (Reuters) - On Dec. 27 last year, Thailand's powerful army chief stood before a crowded news conference and stunned the beleaguered government of Yingluck Shinawatra by saying he would not rule out military intervention to resolve a deteriorating political crisis. General Prayuth Chan-ocha said "the door was neither open nor closed" when he was asked whether a coup would happen. "Anything can happen."
It was a marked shift from the strong coup denials the armed forces had routinely made up until then. Prayuth was not just speaking off the cuff in front of reporters. A document drawn up by the army's chief of staff and dated Dec. 27 - the same day the general faced the media - runs through various scenarios of how the crisis could unfold and how the military should respond.
One of the scenarios details what the army should do "if at any time the situation is beyond the control of police". If that happened, the document says, the army would impose a state of emergency or impose martial law. The document also provides guidance on how to take power "while acting in a neutral manner", and how to help mediate between the warring camps.
As events unfolded over the next five months, the army found itself dealing with most of the scenarios mentioned in the document: failed attempts at mediation, rising political violence culminating in martial law.
There have now been 12 successful coups over the past eight decades of Thailand's modern monarchy. But the latest, on May 22 following a last ditch effort by the military to mediate, did not follow the usual script, which runs: lock down Bangkok while the rest of the country watches with bemusement from the countryside, untouched by events.
This time, the army moved swiftly across the country rounding up politicians, activists and academics, most of them "red shirt" supporters of the ousted government, according to multiple interviews with activists, the military and families of the detainees.
The meticulous moves to put a military government in place - and the lack of any timeline for a return to democracy soon - have many wondering if the generals have plans and scenarios for running the country for a long period of time.
The junta has denied planning the coup in advance. Lt. Gen. Chatchalerm Chalermsukh, the deputy army chief of staff, told foreign media on Thursday that "planning for a coup is treason which is why we did not plan it".
"What we did was a risk, because if we don't carry out our plan properly then we might go to jail or be put to death, Chatchalerm said. "There was no planning in advance."
The junta has suspended the old constitution, muffled the media and imposed martial law - including prosecuting civilians in military courts.
The generals are promising unspecified reforms aimed at ending the power struggle that has stymied the kingdom for years. It is a contest between a royalist establishment, including the military brass, elite bureaucrats and big business, and a mainly rural-based "red shirt" movement loyal to populist former premier Thaksin Shinawatra.
In the months ahead, the military will have to grapple with how democracy will ultimately work in Thailand: through elections that inevitably return a pro-Thaksin government or through an establishment that aims to limit the power of elected - and, in their view, corrupt - politicians.
That question has become ever more acute because King Bhumibol, a revered figure who has reigned for nearly seven decades, is 86 and only recently was released from three years in a Bangkok hospital. Anxiety is growing about his succession.
The Thai army began putting in motion plans to seize control of the country after men armed with guns and grenades killed three and injured more than 20 in an attack on anti-government protesters at Bangkok's Democracy Monument. The May 15 attack at the monument - erected after a 1932 coup that overturned an absolute monarchy - conjured up the military's worst nightmare: civil war in the Kingdom of Thailand, whose ailing king has all but faded from public view. It signalled to Gen. Prayuth that the situation was getting beyond the control of police.
"After that incident, the feeling among prominent members of the military was that the mood of the country had changed and every side was prepared to use violence," army deputy spokesman Veerachon Sukhontapatipak said. "We soon announced martial law (on May 20) to give everyone a chance to retreat. But after that day, clear steps were put in place, and 'option B', which we all wanted to avert, was a coup."
A "judicial coup" preceded the military one, in the view of the ousted government. And it left the military in a dilemma. On May 7, the Constitutional Court removed Prime Minister Yingluck Shinawatra - Thaksin's sister - and several cabinet ministers from office for "abuse of power". Pro-government protesters warned of "civil war" if an unelected leadership was put into office.
But the court unexpectedly decided to leave a rump of the pro-Thaksin government in power as a caretaker administration, and that alarmed the military, according to a source involved in back channel talks between the government and its opponents in the street.
"They (the caretaker government) couldn't sign any national security laws. They were powerless to deal with civil unrest," the source said. That's when the military started thinking about an "option B", the source said.
The army document seen by Reuters said the military needed a Cabinet directive to take control of the streets and disperse protesters, which the caretaker government was unable to give.
The same court in February annulled an election that would likely have returned Yingluck's government to power. In another decision, it banned the use of force to disperse anti-government protesters.
Yingluck herself sowed the seeds of the anti-government movement last November, when the lower house of parliament passed an amnesty bill that could have allowed Thaksin to return from self-exile. Though the bill died, it spawned a protest movement under former deputy premier Suthep Thaugsuban. He demanded the government be dissolved and replaced by an unelected "people's council".
A telecommunications billionaire, Thaksin, 64, revolutionized Thai politics. He won two landslide election victories with his brand of retail politics, populist programmes and crony capitalism. The army ousted Thaksin in a 2006 coup, accusing him of corruption, nepotism, abuse of power and insulting the monarchy. He faces a two-year jail sentence after being convicted in absentia on a conflict of interest charge. From his outposts of exile - London, Dubai and Hong Kong - he has funded and effectively controlled the "red shirt" movement.
Allies of Gen. Prayuth insist he was a reluctant coup-maker, given the army's experience the last time it tried governing. The 2006 army putsch only entrenched political divisions and was infamous for botched policies, including imposing capital controls that caused a 15 percent one-day plunge in Thailand's stock market.
Prayuth, then a major-general, was part of the junta that seized control of the government in 2006. When he was appointed army chief in 2010, he was seen as a hardline royalist, opposed to the red shirt movement. In 2011, Jatuporn Promphan, a red shirt leader and member of parliament, was imprisoned for making comments deemed to be disrespectful of the monarchy. The case was prompted by a complaint by Prayuth.
Plans for a full military takeover were already advanced when Prayuth declared martial law on May 20 - two days ahead of the coup - ostensibly to maintain order while the politicians worked out a solution, a senior military officer said.
"From the moment martial law was announced, there was a 50-50 chance he would take power, but he first wanted to give all sides a chance to back down," the military officer said.
The junta has provided no timeline for when fresh elections would be held, but have indicated it won't be any time soon.
The coup contingency planning documents seen by Reuters details how to give power back to the people "in the shortest time possible".
Chatchalerm, the deputy army chief of staff, said conditions had to be right and divisions healed before there could be a return to civilian rule.
"How long it takes to heal divisions between two groups that has been going on for 10 years?" Chatchalerm asked foreign media.
After the Sept. 19, 2006 coup, it was 15 months before elections were held, in December, 2007.
Prayuth's new team of advisers, a junta kitchen cabinet, includes a former defence minister, General Prawit Wongsuwan, and former army chief General Anupong Paochinda. The two are towering figures in Thailand's military establishment and have close ties to Prayuth. All three are staunch monarchists who helped oust Thaksin in 2006.
A Reuters report in December revealed Prawit and Anupong had secretly backed the anti-government protests that undermined Yingluck's government.
The junta faces an uphill struggle to revive Thailand's economy, which contracted 2.1 percent in the first quarter from the previous three months, and some economists say a recession may be unavoidable.
Prayuth's advisor overseeing the economy is Pridiyathorn Devakula. He was finance minister in the military-installed government following the 2006 coup that introduced strict - and, after the stock market tanked, short lived - capital controls to prop up the Thai baht.
DECAPITATING THE RED SHIRTS
In Bangkok, the junta publicly summoned at least 258 activists, intellectuals and journalists to report to army bases. The purpose of the round-up was to "calm everyone down", prevent further incitements to violence, and silence critical comment that "might affect the military's work", according to junta statements. Almost all of them have been released.
But in "red shirt" country in the north and northeast, where the potential for anti-coup dissent is much greater, the military is conducting a more draconian sweep and things have been less transparent.
"At least in Bangkok, the military issues a formal announcement. But in the provinces it's informal," said an academic from the northern city of Chiang Mai who is in hiding. "They just show up in a truck and take you away."
In Chiang Mai province, the Shinawatra family powerbase, local Army commander Major General Sarayuth Rungsri declined to answer questions about how many people were detained.
Interviews with activists, academics, detainees' families and the military reveal at least 20 red shirt organisers were taken into custody in Chiang Mai and neighbouring Chiang Rai province. Most were released on Tuesday.
Those who were detained say they were made to sign documents - euphemistically entitled "Memoranda of Understanding" - pledging to swear off political agitation, incitement or unauthorised travel. They were warned that breaking the contracts could mean prosecution and up to two years jail.
"They questioned us on whether we're radical, whether we're stockpiling weapons," a Chiang Mai red shirt leader who was detained for six days, and who declined to be identified, told Reuters.
The red shirt leader said he was held with 11 other activists on an army base in comfortable double bedrooms. Detainees were briefly questioned at the start and end of their time at the base, as well as given briefings by army officers to "correct their perceptions", the leader said.
Asked if the army's efforts succeeded in changing his mind, the red shirt leader said: "Let's just say I know the answer, but I can't say it out loud. It's like I have something stuck in my throat. I'm bound by the conditions of my release."
At least half a dozen academics and activists, most unaffiliated with the red shirts, are on the run. None of the names of those detained were found on lists released by the army in Bangkok.
In Chiang Mai, the military's tightening grip has thwarted the kind of uprising that Thaksin's loyalists warned of in the lead-up to the military takeover.
Sarayuth said he would be clamping down further.
"Whenever we have a report that one or two people are preparing to do something, we will go and control the situation," he said.
Daily protests peaked in Chiang Mai on Saturday, when at least 200 people jeered at and sporadically scuffled with police, but have fizzled since. Attempts by anti-coup activists to organise flash mob-style protests via social media and mobile messaging have been foiled by military intelligence gathering, with soldiers taking over rally sites in advance.
At least 16 people have been arrested in Chiang Mai and Chiang Rai at anti-coup protests. Chiang Mai and Chiang Rai are just two of 36 provinces in the north and northeast. It is not clear how many people have been detained across the entire region.
In the northeastern province of Khon Kaen, another red shirt stronghold, local activists say seven of their leaders have been detained. Their names were absent from army lists disclosed in Bangkok.
DEFUSING THE ROYALISTS
Some in Bangkok believe the coup was a way out for protest leader Suthep, whose support had been dwindling in recent weeks and whose ultimatums for the government to step down were going nowhere.
For months, leaders of his People's Democratic Reform Committee (PDRC), backed by Thailand's conservative royalist establishment, had called on the army to intervene.
Samdin Lertbutr, an anti-government protest leader, said protesters knew the army would step in if the government did not stand aside, but told Reuters there were no closed-door meetings between the army and the PDRC leadership.
"We weren't surprised the army staged a coup. It was not the result we wanted," Samdin told Reuters. "We wanted a people's revolution, and up until Thursday (May 22), we believed that's what we were going to get. There were no meetings between us and the army to discuss the possibility of a coup."
A second PDRC leader, Somsak Kosaisuk, agreed that the protest group did not know a coup was imminent when they attended talks at the Army Club that Thursday aimed at trying to reach a compromise with the caretaker government.
Army chief Prayuth "asked the government side one more time whether it would resign before he took power," Somsak said.
"They said they would not."
That's when Prayuth calmly announced he was taking power. "Everyone must sit still," Prayuth said, according to two sources who attended the meeting.
Immediately after that, hundreds of troops surrounded the Army Club and whisked away everybody from the building. By bringing all sides together for the talks, Prayuth's forces were able to detain many of Thailand's most powerful political figures at the same time. The coup had gone off without a hitch. (Additional reporting by Panarat Thepgumpanat and Pairat Temphairojana; Editing by Alex Richardson and Bill Tarrant)