By 2:50 p.m., the marathon’s winners had long since crossed the finish line, leaving Boston’s Copley Square to throngs of ordinary athletes who trotted the race’s final yards past thick crowds of spectators. Runner Kara Zech Thelen had just cleared the last marker when a monstrous thunderclap spun her around.

“It looked as though a building near the finish line had blown up,” said Thelen, who stared as a wall of fire, glass and debris erupted from a storefront a few dozen yards away. She saw a huge cloud of smoke, oddly greenish-brown, billowing from the shattered building and then: nothing.

“It was pure silence,” she said.

A second later, the posh downtown square was transformed into a scene like something from central Baghdad, with panicked runners and onlookers fleeing amid screams from scores of wounded, past blood-splattered sidewalks strewn with body parts. Even in the confusion, many grasped instinctively what had happened.

“As soon as I heard it, I knew it was a bomb,” said Paul Cummings, a 44-year-old runner from Portland, Ore., who was in a medical tent near the finish line getting a leg massage when the bombs exploded. “It was just a loud explosion, and then another. You can’t hear a noise like that and think anything good happened.”

The blasts occurred near the end of the Boston Marathon’s 117th running, on an idyllic afternoon with cool temperatures and bright sunshine. The fastest runners finished the race just after noon, but a bulge of slower competitors was converging on the finish line just before 3 p.m., flanked by rows of colored flags.

When the first blast struck, some runners who were nearby stopped in their tracks, confused and unsure. Then the second explosion happened half a block away, with a deep boom and an orange flash caught by TV cameras and cellphones.

Pam Ledtke, 51, of Indianapolis was about 75 yards from the finish line when the explosions occurred. At first, she said, “everyone just stopped and hunched down. They didn’t know what to do. It took a minute or two to think: ‘Did something technical go off?’ Then the smell — it was firecrackers,” she said. When the second blast occurred, “all of a sudden people were screaming.”

Bruce Mendelsohn, 44, who works for an engineering leadership program at MIT, was at the marathon as a spectator; his brother, Aaron, had finished the race about an hour earlier, and they were at a party on the third floor of a nearby building when the blasts hit.

Mendelsohn ordered other guests to move away from the windows, then rushed downstairs to a scene of carnage. “People were on the ground lying down. Some people were walking wounded,” he said. “It was like a scene from Tel Aviv or Baghdad or Pakistan.”

Giovanna Tosato, 64, of Bethesda, had just had the marathon medal placed around her neck when she heard the first blast, then the second. Chaos ensued as volunteers tried to hurry exhausted runners out of the area, she said. “All the volunteers are pushing the runners to run, and the runners couldn’t run — they had just finished the marathon,” she said. “Some were cramping.”

Seven stories above the confusion, Charlotte Holler, 24, was at work in the nearby Prudential Tower when she felt the explosions rock the floor under her feet. She said she initially feared that something was collapsing. Holler and her colleagues ran to the windows to see smoke-filled streets and scores of marathoners turning away from the finish line, sometimes hurtling over barricades to get away.

The event at the finish quickly reverberated back through the line of runners.

Amanda Burgess, 35, of Nashua, N.H., was short of the finish line. When she heard that there had been bombs, she said, “I had a panic attack. My kids were at the finish line, waiting for me.” It took her 30 minutes to get through the jammed cellphone network to determine that her 7- and 9-year-olds were safe.

Michael Johnstone, 57, a runner from Newton, Mass., was nearly two miles from completing the race when he noticed people in police uniforms and emergency gear going the other way.

“I thought it was a breakdown in security, but then we were stopped,” he said.

Many runners who retreated from the course later came back to try to find their bags of clothes, which were located at buses near the finish line. Police shooed them away as fears of additional bombs prompted authorities to rope off an ever-expanding security zone.

As the afternoon shadows grew, runners stood shivering in their shorts in Boston’s historic Public Garden. The adjoining Boston Common was taken over by rows of police and National Guardsmen.

George Stavros, 49, a psychology professor at Boston University, had tried to complete the 26.2-mile course. A short distance before the finish line, word of the bombings began to spread among runners, but he kept going.

“Once we got past [mile] 25, a police officer said, ‘Your race is over,’ ” Stavros said. He and his daughter were dumbfounded and didn’t stop. Then a second cop approached them.

“The race is over,” he said, turning all the runners back.

Warrick reported from Washington. David Montgomery, Mary Beth Sheridan and Doug Struck contributed to this report from Boston. Leonard Bernstein, Carol D. Leonnig and Lyndsey Layton contributed from Washington.