While Pawan Chamling's SDF got 15 seats in the hill state, Sikkim Krantikari Morcha, which was formed in 2013, got 17 seats.
Five-time Chief Minister Pawan Kumar Chamling's tenure ended in Sikkim on Thursday after over 24 years in power as his party, the Sikkim Democratic Front or SDF lost the state elections to a resurgent Sikkim Krantikari Morcha or SKM.
While the SDF got 15 seats in the hill state, Sikkim Krantikari Morcha, which was formed in 2013, bagged 17 seats, one more than required for a majority in the 32-member Assembly.
Chamling, however, was elected from two assembly constituencies in the state assembly elections, Election Commission officials said.
He had contested the elections from Namchi Singhithang and Poklok Kamrang assembly constituencies, they said.
He won the Namchi Singhithang assembly seat by a margin of 377 votes, they said.
In the Poklok Kamrang seat, the Sikkim Democratic Front (SDF) supremo defeated Kharka Bahadur Rai, his nearest rival of Sikkim Krantikari Morcha by 2,899 votes, they added.
Chamling has been the chief minister of Sikkim for more than 24 years since December 1994.