His calculated guess stems from the razor thin victory secured by the ruling government in parliament yesterday to remove the speaker of the House.
It showed Prime Minister Tan Sri Muhyiddin Yassin may lack a parliamentary majority, he said.
In the crucial vote Muhyiddin on Monday succeeded in his bid to replace Tan Sri Mohamad Ariff Md Yusof by a margin of two votes, after 111 MPs voted in favour and 109 opposed it.
“It is not even a simple majority. It is clear that it is a hung parliament,” Shafie told a group of reporters in Kuala Lumpur.
“Elections are not far away, it’s just around the corner.”
According to a Reuters news report Shafie was inclined to think that a general election would be called well before it is due in 2023.
He said the parliamentary vote on the 2021 budget in November would be another crucial test for the government.
Shafie, who is Semporna MP, is one of the two proposed opposition prime ministerial candidates, the other being PKR president Datuk Seri Anwar Ibrahim.
However Shafie today said he was still weighing whether to be a candidate.
Shafie has been endorsed by an independent bloc led by former prime minister Tun Dr Mahathir Mohamad and Anwar by the Pakatan Harapan coalition.
Shafie who is president of Parti Warisan Sabah is being widely held as the solution to much wrangling over the top job between Dr Mahathir and Anwar.
Shafie said his name was first proposed by DAP, the largest in the opposition, as well as Amanah with Dr Mahathir backing the move.
DAP and Amanah have since wavered in their position as the wider coalition struggle to agree on a candidate.
Anwar lacks the support to become premier, Shafie was quoted as saying in a Bloomberg report.