Al-Maliki also appeared to signal that Tehran would not be squeezed out by any agreement, saying Iraq's "development and stability will be provided through more bilateral cooperation" with Iran.
Ahmadinejad, in turn, underlined that Iran had a key role in Iraq's security.
"The responsibility of [Iraq's] neighbours is doubled in this regard," he said, according to the website.
Ahmadinejad hinted at concerns that the security agreement would mean US domination in Iraq.
"Iraq must reach a certain level of stability so that its enemies are not able to impose their influence," he said, without specifically mentioning the deal.
An aide to al-Maliki said he is is offering assurances in the talks that the US presence in his country is no threat to Iran.
But he will also complain about Iran's public campaign against the agreement as interference in Iraq's internal affairs, the aide said.
The Iranian state news agency IRNA said al-Maliki held separate talks on Sunday with Parviz Davoodi, the Iranian vice-president.
During the talks, Davoodi said Iran will always stand by Iraq, and al-Maliki said Iraq hopes for Iranian help in various areas, including "political, cultural, economic and defence".
Iran fiercely opposes the US-Iraqi security agreement, saying it will lead to permanent American bases on its doorstep in Iraq, reflecting Tehran's fears US forces could attack it.
Saeed Laylaz, a political analyst and editor of the Sarmayeh newspaper in Tehran, told Al Jazeera that the US is not ready to discuss a comprehensive security plan for the whole region.
"They want to talk about security only in Iraq," he said.
"They want to ignore the security concerns of Iran."
Last week, Akbar Hashemi Rafsanjani, a powerful Iranian politician, said the deal would "enslave" Iraqis and vowed it would not be permitted to be passed, and Iran's pro-government press has frequently railed against it.
In another issue affecting ties between Baghdad and Tehran, al-Maliki is like to raise once more the US allegations that Iran is arming, funding and training Shia militia members in Iraq.
Iran has denied the charges, saying it supports Iraq's security and stability.