What played out Monday across the streets of greater Boston was, in some ways, humankind at its best — its fittest specimens, amid its largest, happiest, wildest public gathering, in its proudest show of civic resolve and unity. The 118th Boston Marathon, run under a crisp, blue mid-spring sky on the traditional Patriots Day, was marked by record crowds, historic individual performances and nary a sign of visible danger or destruction.

That it came 371 days after a display of humankind at its worst, on the same occasion and at the same setting, brought the venerable race its emotional power, as well as an overwhelming show of security and more than a few rattled nerves. But in the end, what made the marathon a success was the fact it looked and felt the way marathon day should look and feel in Boston — and has felt for generations — only bigger and better.

“It was a most memorable, amazing day for the city of Boston and our nation,” said Shalane Flanagan, a Marblehead, Mass., native who finished seventh in the women’s race. “The fans were out of this world, phenomenal, almost deafening. I felt my insides were shaking, it was so loud.”

Around the time, shortly after noon, that San Diego’s Meb Keflezighi, pursued by a pair of Kenyans, made the left turn onto Boylston Street in the race’s homestretch — to cheers of “U-S-A! U-S-A!” — the tragedy of a year ago all but receded from memory. Keflezighi, 38, zoomed past the sites of the April 15, 2013, bombing, where spectators were again pressed 10-deep against the barricades, and crossed the finish line — with a time of 2 hours 8 minutes 37 seconds — as the first American man to win Boston since 1983.

Afterward, Keflezighi acknowledged he used the crowd’s energy and the emotion of the day to power himself through the finish line.

“I knew [the Kenyan pursuers] were coming for me,” Keflezighi said. “But I kept thinking, ‘Boston Strong. Boston Strong. Meb Strong. Meb Strong.’ . . . It couldn’t happen at a better time, to win for America.”

A year ago, Keflezighi, injured at the time, was among the spectators lining Boylston Street near the finish line. He left to go to his hotel room about five minutes before the bombs detonated not far from the spot he had just vacated. Aside from the three who were killed that day, more than 260 spectators were injured, including more than a dozen who lost limbs. On that day, just as on this one, Keflezighi clutched a loved one and cried. Only this time, he said, "They were tears of joy.”

The women’s race Monday featured a bit of history as well, as Kenya’s Rita Jeptoo, the 2006 and 2013 champion, won with a ­course-record time of 2:18:57.

As dawn broke, the 32,408 runners who started the race — the second-biggest field in the race’s history — began making their way to the buses that would carry them to the starting line in Hopkinton, west of the city. Many clutched clear plastic, see-through bags holding their belongings — one of many new security procedures in place this year.

With the entrants amassed, a moment of silence was observed for the three victims of the bombing — Martin Richard, 8; Lingzi Lu, 23; and Krystle Campbell, 29 — plus M.I.T. police officer Sean Collier, who was killed in a subsequent shootout with the alleged bombers.

Shortly before the start of the elite men’s portion of the marathon, race director Dave McGillivray, who himself has completed 41 Bostons, addressed the crowd over a loudspeaker. “We’re taking back our race today,” he declared. “We’re taking back the finish line!”

By that point, hours before it would see any finishers, the finish-line area was already swelling with spectators. By 9 a.m., all the bars and restaurants along Boylston were packed, and by 9:30 every inch of prime real estate near the barricades — with their unimpeded views of the finish line — was taken. This was true even for the spots in front of Marathon Sports and The Forum restaurant, the establishments in front of which the bombs exploded a year ago.

A look at today's race and the factors that may have helped the winner.

“I didn't make it to the marathon last year but had to be here this year,” said Mark Hennigan, 47, of Boston, who was watching the race from The Forum's front porch. “After all this restaurant, this street, this city has been through this year, how could I miss it this year?”

The urge to make this marathon feel as normal as possible butted heads at times with the need to keep everyone safe. The law-enforcement presence was massive and at times intense: bomb-sniffing dogs, security wands, bag-check checkpoints, dozens of surveillance cameras, and police on foot, in helicopters, on bicycles, on motorcycles, on rooftops, in uniform and out. Local officials expected the law enforcement force on site to number around 3,600 officers, about double last year’s.

The bolstered security measures did little to keep people away. Officials were expecting record crowds, perhaps even a million people, to line the 26.2-mile course. By mid-afternoon, police were preventing new spectators from entering the finish-line area because of overcrowding, and — once the Boston Red Sox’ traditional 11:05 a.m. Patriots Day game ended and fans spilled out of Fenway Park to watch the marathon — advised spectators to avoid the suddenly packed Kenmore Square area.

“I was glad for the security. It didn’t feel overwhelming — it felt safe,” said Christine Nikles of Nazareth, Pa., who was attending her second Boston Marathon and who passed through a wand-check and a bag-check to get to her VIP grandstand seats near the finish line. “It was like getting on a plane.”

The first entrants to cross the finish line came on wheels, with Tatyana McFadden, a Sochi 2014 Paralympics silver medalist and a Clarksville, Md., resident who attended Atholton High in Columbia, winning the women’s wheelchair division — on her 25th birthday — for her second straight Boston title. McFadden competed with a race bib that said “MARTIN RICHARD” on the back to honor the 8-year-old Boston boy who was the youngest of the bombing victims.

Next came the elite runners, at something close to a sprint. Keflezighi was ahead by nearly a minute near the midway point, but his lead was cut to six seconds by the final mile, until a strong finishing kick took him through the finish line 11 seconds ahead of his nearest pursuer.

Eventually came the mid-pack hordes of solid runners and the back-of-the-pack hordes of the injured, the aged or the perennially slow. Though Boston has strict time-qualification standards, it also lets in runners who raise money for charity, and this year’s field was swollen beyond its usual cutoff of 26,000 when organizers invited bombing survivors, first responders and some 5,600 runners who failed to finish in 2013 because of the attacks. Some bombing survivors were escorted onto the course near the end to cross the finish line with the runners competing on their behalf.

Perhaps never before had the simple act of running, of putting one foot in front of the other, for two, three, four or five hours, seemed so important for a city. And as the sun set on Boston, these tens of thousands of runners and their families and friends packed the restaurants and bars to do something they never got the chance to do a year ago — celebrate.

Wesley Lowery contributed to this report.