In a rare televised address, Mr Mahdi stuck a conciliatory tone as protesters demanded his resignation.
The PM said he would respond to their concerns, but warned there was no "magic solution" to Iraq's problems.
At least 20 people have died in the unrest as anger at unemployment and corruption boiled over.
A curfew has been imposed in Baghdad and several other cities in Iraq's southern provinces - but thousands defied it and security forces fired live rounds at them.
The Iraqi teenager married too many times to count
What did PM Mahdi say?
Calling on lawmakers to support him, Mr Mahdi promised to pass a new law granting poor families a basic income.
"I am reaffirming that your voice was heard before you even started protesting," Mr Mahdi said.
But he added that it would take time to bring about change.
The protests, which appear to lack any organised leadership, are the largest since Mr Mahdi became prime minister a year ago.
The UN and US have expressed concern at the violence and urged the Iraqi authorities to exercise restraint.
On Thursday, human rights group Amnesty International has called on the government in Baghdad to immediately rein in its security forces.
What happened on Thursday?
An indefinite curfew began in Baghdad at dawn applying to everyone except those travelling to and from the capital's airport. Ambulances and religious pilgrims were also excluded.
Security forces blocked major roads and bridges. Access to the internet was also limited, making it harder to organise protests on social media.
But thousands of protesters gathered in and around Tahrir Square - the focus of the recent unrest - prompting riot police to fire tear gas and shots in the air to disperse them.
"We'll keep going until the government falls," Ali, a 22-year-old unemployed university graduate, told AFP.
"I've got nothing but 250 lira ($0.20; £0.16) in my pocket while government officials have millions."
Violence has been concentrated in Baghdad and in the majority Shia Muslim areas of the south. Northern Kurdish regions and Sunni-majority areas in the west remain mostly calm.
On Thursday, police and hospital sources told Reuters that protesters had been killed in the capital, and also in and around the southern cities of Amara, Diwaniya, Hilla and Nassiriya, among others. Hundreds have been wounded.
Overnight on Wednesday, explosions were heard in Baghdad's heavily fortified Green Zone, where government offices and foreign embassies are located.
The US-led coalition fighting the Islamic State group in Iraq said none of its facilities were hit and that Iraqi security forces were investigating the blasts.
What triggered the unrest?
The protests appear to be the result of a spontaneous upwelling of frustration at Iraq's high youth unemployment rate, its dire public services and chronic corruption.
Simona Foltyn, a journalist based in Baghdad, told the BBC's World Update programme: "The demonstrators I have spoken to so far have said that these protests are a grassroots movement, comprised of a variety of people - men, women, graduates, the unemployed, the elderly - who are all airing grievances that have accumulated over the past years."
"They have all denied the involvement of any political party. They are, in fact, extremely disenfranchised and disappointed with the political establishment here."
She added: "All of the people who are protesting seem to be united in one thing: they want a better life. They want services, they want jobs, and they want living standards to go up."
Last year, the southern Iraqi city of Basra was rocked by weeks of protests over unsafe drinking water, power shortages, unemployment and corruption. Government offices, including the main provincial council building, were set alight.
What is the economic situation like in Iraq?
Iraq has the fourth-largest reserves of oil, but 22.5% of its population of 40 million were living on less than $1.90 (£1.53) a day in 2014, according to the World Bank. One in six households has experienced some form of food insecurity.
The unemployment rate was 7.9% last year, but among young people it was double that. And almost 17% of the economically active population is underemployed.
The country is also struggling to recover after a brutal war against the Islamic State group, which seized control of large swathes of the north and west in 2014.
The Iraqi government and World Bank estimated last year that $88bn (£71bn) was needed to fund short- and medium-term reconstruction.
Just over one million people are still internally displaced, while 6.7 million are in need of humanitarian assistance, the UN says. Living conditions are dire in many conflict-affected areas, with insufficient basic services.