"Today, the world stands at a crossroads. Continuing along the path of confrontation is more costly and futile than ever before," the president wrote in his message.
Iran had seen many aggressors throughout its history: "All that remains of them are tarnished names in history, while Iran endures - resilient, dignified and proud," Pezeshkian wrote.
The choice between war and peace would shape the future of entire generations, he wrote.
By Iranian standards, an open letter to the people of the US is rather unusual.
Observers therefore see it as an attempt by Iran to convince the US public that its government's decision was wrong and thus indirectly force a ceasefire.
The war launched by Israel and the US is in its fifth week.
On Wednesday, US President Donald Trump said Iran had asked for a ceasefire.
Iran's foreign ministry spokesman immediately rejected that.
State broadcaster IRIB quoted Esmail Baghaei as saying Trump's statements were false and unfounded.
Trump attributed the request for a ceasefire to Iran's "New Regime President".
It remained unclear whom exactly he meant by that.
Trump is to give a speech on Wednesday evening.
He issued Iran with an ultimatum that will expire on the evening of April 6.
By then, the country is to reopen shipping through the Strait of Hormuz, which is important for oil transport.
Since Israel and the US began the war on February 28, shipping through the strait has largely come to a standstill.