LONDON (Reuters) - Iranians should not thank Hassan Rouhani’s policy of detente with the West for any reduction in the threat of war, supreme leader Ayatollah Ali Khamenei said on Sunday, stepping up his criticisms of the president as elections approach.

Iran's Supreme Leader Ayatollah Ali Khamenei gestures as he speaks during a meeting with Iranian officials and ambassadors of Islamic countries, in Tehran, Iran, April 25, 2017. Leader.ir/Handout via REUTERS

In comments that appeared to favor hardline candidates in the May 19 vote, Khamenei played down the benefits of Rouhani’s landmark agreement to curb Iran’s nuclear activities in return for a lifting of international sanctions.

“Some say since they took office the shadow of war has been faded away. This is not correct,” Khamenei was quoted as saying by state media.

“It’s been people’s presence in the political scene that has removed the shadow of war from the country.”

Khamenei and his hardline supporters have also criticized the nuclear deal -- which stiffled talk by Washington of possible military action against Iran -- for failing to deliver promised economic benefits.

But speaking at the opening of a refinery that Iran says will make it self-sufficient in oil products, Rouhani defended his position.

“The nuclear deal was a national achievement. We should make use of its advantages. But some have started a fight over it,” Rouhani said. He cited the new refinery, in the Gulf port city of Bandar Abbas, as a result of the deal and “interaction with the world”.

One of Rouhani’s main challengers, Ebrahim Raisi, an influential cleric with decades of experience in the hardline judiciary, said Iran had no need of foreign help to improve the economy and could always defend itself.

“We should not warn our people of wars and crises. We have full security in the country,” Raisi said in a recorded address on state television.

“This approach, that we should wait for foreign investment and for foreigners to resolve our issues, is wrong.

“This is wrong, to wait years and years for foreign investors to come ... We should resolve issues by relying on domestic capabilities,” Raisi said in comments that echoed those previously made by Khamenei, Iran’s highest authority.

Rouhani has said Iran needs foreign capital to modernize its oil and gas, transportation and telecommunication sectors after decades of international isolation.

However, foreign investors are still cautious about trading with or investing in Iran, fearing penalties from remaining unilateral U.S. sanctions and President Donald Trump’s tough rhetoric on the Islamic Republic.

This has caused long delays in contracts that Iran seeks with international firms to develop its oil and gas fields.