A photograph of 35-year-old Mashrafe, who enjoys rockstar status in cricket-mad Bangladesh, alongside Hasina ran on the front pages of many newspapers in the South Asian nation of 160 million.
A spokesman for Hasina's Awami League said Mashrafe had been given the "green light" from the prime minister, who is seeking a third consecutive term in office on December 30.
"He plans to contest from Narail," said spokesman Mahbubul Alam Hanif, referring to Mashrafe's hometown district in western Bangladesh.
Mashrafe has not commented publicly on his running for the Awami League.
Cricketing authorities said there was no prohibition on active players trying their hand at politics.
"To run in an election is his constitutional right. If he wants to exercise these rights, we have no issue," Bangladesh Cricket Board spokesman Jalal Yunus told AFP.
"We expect him to keep the balance between his playing career and politics."
An alliance of opposition parties led by the Bangladesh Nationalist Party (BNP) will contest the election, despite their leader and thousands of supporters locked behind bars.
Cricketers moving into politics is nothing new in South Asia, where star players command god-like devotion from millions of fans. However, it is rare for a sitting player to make the change.
Mashrafe is widely expected to retire after the World Cup in 2019.
He has already retired from T20Is and has not played a Test match since 2009.
Some fans welcomed his decision but others worried it would tarnish his reputation.
"I may be wrong, but this is the worst decision of his life," one fan, Omar Faruq, wrote on Mashrafe's fan page on Facebook.
First Published: November 12, 2018, 3:17 PM IST