Huda Omari sat outside a broker’s office in Jordan for two days, waiting for her visa to make the annual hajj, or pilgrimage, to Saudi Arabia.

In Egypt, Magda Moussa’s three sons pooled their resources to scrape together nearly $9,000 to realize a dream of accompanying their mother to the hajj. When she got the go-ahead for the trip, she said, relatives and neighbors in her village ululated in celebration.

The dayslong pilgrimage is a profound spiritual journey and an arduous trek under the best of circumstances. ​But this year, amid record ​h​eat, at least 1,300 pilgrims did not survive the hajj, and Saudi authorities said that more than 80 percent of the dead were pilgrims who lacked permits.

Ms. Omari and Ms. Moussa were among a large number of unregistered pilgrims relying on illicit or fraudulent tour operators to skirt the official permit process.​ Both said they were aware that the once-in-a-lifetime trip would be physically and financially demanding, but neither foresaw the terrible heat or mistreatment they would endure.

“We were humiliated and punished for being there illegally,” Ms. Omari, 51, told The New York Times after returning home.

With nearly two million people participating each year, it is not unusual for pilgrims to die from heat stress, illness or chronic disease during the hajj. And it is unclear whether this year’s toll was higher than usual because Saudi Arabia does not regularly report the numbers. Last year, 774 pilgrims died from Indonesia alone, and in 1985 more than 1,700 people died around the holy sites, most of them from heat stress, a study at the time found.