Funeral events for Iran’s president and foreign minister began in northwestern Iran on Tuesday as investigators looked into the helicopter crash that killed them and the country grappled with the shock of losing two of its most prominent leaders at a volatile moment.

Iran’s supreme leader, Ayatollah Ali Khamenei, has announced five days of mourning for the president, Ebrahim Raisi, 63, and the foreign minister, Hossein Amir Abdollahian, 60, who died when their helicopter plunged into a mountainous area near the Iranian city of Jolfa on Sunday. The state news media said the crash had resulted from a “technical failure.” Iran’s Armed Forces said it had begun an investigation and sent a team to the site.

Videos posted by Iranian news agencies showed crowds lining the street behind barriers on Tuesday morning under a gray sky in the northwestern city of Tabriz, awaiting a procession carrying the flag-draped coffins of Mr. Raisi, Mr. Amir Abdollahian and the six others killed in the crash. Some people held photographs of Mr. Raisi; the semiofficial Tasnim news agency reported that the country’s interior minister and acting president had been spotted in the crowd.

The funeral procession in Tabriz, the closest large city to the site of the crash, was the first in a series of official events to bid farewell to the president, a hard-line cleric who came of age during the country’s Islamic revolution and oversaw a deadly crackdown on protesters as the head of the judiciary in 2019 and as president in 2022. He had been widely viewed as a potential successor to Ayatollah Khamenei, 85.

While some Iranians mourned Mr. Raisi, others welcomed the loss of a man they viewed as a key figure in a corrupt regime who oversaw the execution of dissidents, used violence to suppress and kill protesters, and arrested journalists and activists.

After the events in Tabriz, the bodies of Mr. Raisi and the others killed in the crash are due to be taken to the city of Qom and then to Tehran, the capital, by the evening.