The seventh time she ran the Boston Marathon, Keila Merino woke up early before the race and joined a few other runners at 5 a.m. at the finish line on Boylston Street. The group hooked a right on Hereford, a left on Commonwealth, and continued for the next 25-plus miles, finishing at the starting line.

Then Ms. Merino turned around and ran the official race, finishing it in 3 hours 24 minutes.

The next day, she was back in her work clothes teaching her fourth-grade bilingual students at Public School X114, an elementary school in the Bronx.

Barely five feet tall, with long, deep brown hair, Ms. Merino, 34, is one of the top ultramarathoners in the country, routinely finishing among the top three in races of 50 or 100 miles. Her journey to ultradistance running began in childhood, when she traveled from Mexico with her mother and four siblings to Mesa, Ariz., to rejoin her father. Her fourth-grade gym teacher was her original inspiration.

“I didn’t understand any of the exercises he told us to do because my English was so poor,” Ms. Merino remembered. “So he said, ‘Just run.’ ”