A new chief of Thailand's army took command on Friday, a staunchly royalist general who will oversee a return to barracks to make way for a civilian government after nearly five years of military rule.

General Apirat Kongsompong, 58, belongs to the King's Guard faction in the First Infantry Division of the First Army Region - a group at the very heart of the royalist military establishment.

The relationship between the monarchy, the army and politicians is the fundamental factor determining stability in Southeast Asia's second-biggest economy.

Apirat is the son of General Sunthorn Kongsompong, who led a 1991 coup that triggered a groundswell of opposition from a growing middle class, which resulted in the military's return to barracks in 1992 for 22 years, until the last coup in 2014.

Bangkok's media portrays Apirat as a "trusted lieutenant" of Prime Minister Prayuth Chan-ocha, who conducted the 2014 when he was army chief, and as a commander who would prefer to remain aloof from politics.

"I will do my best for the nation and the people," Apirat said in a speech before taking up his post.

Prayuth has promised to hold a general election by May under a new constitution that civilian critics say is aimed at limiting the role of political parties while enshrining military influence.

Prayuth has declined to confirm his plans amid widespread media speculation he will seek to stay on in power as an unelected prime minister. He has hinted he could take up a public role after the election.

The election will provide a closely watched test of the popularity of self-exiled former premier Thaksin Shinawatra.

The former tycoon won widespread support in the countryside for pro-poor policies but the animosity of the military-linked Bangkok establishment, which derided his election-winning ways as corrupt vote-buying.

King Maha Vajiralongkorn, who ascended the throne in 2016 following the death of his father, King Bhumibol Adulyadej, appears to have a smooth relationship with the generals running the country.

Apirat's appointment indicated the consolidation of that relationship, said Paul Chambers, a lecturer at Naresuan University and a specialist on the Thai military.

"The army will likely become even closer to the monarchy," Chambers told Reuters.