The defeat of the ruling People's Democratic Party (PDP) of Prime Minister Tshering Tobgay in Bhutan is seen as a major upset in an election being closely watched by India and China.
With a population of about 800,000, Bhutan is considered a buffer between China and India.
The country, cloistered for many years, started opening up slowly to the world over a decade ago. The king is still widely respected and holds a lot of power but the country transitioned to a democracy in 2007 when it held its first parliamentary elections.
The Druk Nyamrup Tshogpa (DNT), a relatively new party which was formed in 2013 and came third in the elections that year, won first place at last Saturday's polls, Bhutan's third elections, taking 92,722 out of 291,098 votes in the first round of voting.
The Druk Phuensum Tshogpa (DPT) came in second with 90,020 votes, while Mr Tobgay's party won 79,883 votes.
According to the Bhutanese Constitution, only two parties will face off in the last round of general elections, which has been set for Oct 18.
The Bhutanese, a local newspaper, called it a "major election upset" while another newspaper, Kuensel, noted that people had voted for change and anti-incumbency had played a big role.
The left-of-centre DNT, which pulled off the surprise win in the first round, is led by surgeon-turned-politician Lotay Tshering, whose campaign platform comprised development issues, particularly health access and facilities. These issues, according to analysts, struck a chord with voters, especially in the rural areas.
"This is a typical example where election and results can be totally unpredictable," said Dr Tshering. "I am more convinced that improvement in healthcare services, especially those in rural areas, cannot be more emphasised."
There has been some disquiet in India, which has traditional links with the small country, over the defeat of Mr Tobgay, with whom it had close ties.
"India needs to boost efforts as Bhutan polls spring a surprise," said a headline in The Times of India while other reports highlighted how a "pro-India party" had been knocked out.
Until 2007, India had oversight over Bhutan's relations with other countries. This changed after the two countries amended their friendship treaty, giving Bhutan full freedom to pursue ties with other countries. While people in Bhutan are appreciative of the country's close ties with India, there are those who feel that Bhutan also needs to establish diplomatic links with China, which has been trying to make inroads into the small country.
The debate on ties with China deepened following the Doklam crisis in June last year, which led to a standoff between India and China on the Doklam plateau. The row arose when Indian border guards intervened as China was building a road in an area claimed by both it and Bhutan, close to a narrow stretch of land in India known as the Siliguri corridor. The corridor connects seven north-eastern Indian states to the mainland. The issue was resolved after nearly a month.
In 2013, India cut fuel subsidies to Bhutan suddenly, triggering speculation that the move was a warning to Bhutan's first prime minister, Mr Jigme Y Thinley, not to establish links with China.
In a sign of continuing Chinese interest in Bhutan, China's ambassador to India Luo Zhaohui visited the country ahead of the elections.
However, analysts in India believe the close ties between India and Bhutan will continue, and that any winning party would have the blessings of the king. Former foreign secretary Lalit Mansingh has said the maturing democracy in Bhutan is a positive sign.
"I don't think we should get worried. This time round, India was not an election issue. They are becoming a truly democratic society. One party loses and another takes over. It's good news for democracy," said Mr Mansingh.
"China, of course, has so far been frustrated in wanting to have close diplomatic ties with Bhutan. But sooner or later Bhutan, despite the traditional friendship (with India), has to chart its own course in international affairs," he added.