BOSTON – Nearly 36,000 runners set out from the Boston Marathon starting line with security tight along the 26.2-mile (42-kilometer) course Monday, in a show of resilience a year after the bombing that turned the race into a scene of carnage.

American Meb Keflizighi, a former New York City Marathon champion and Olympic medalist, won the men’s title in 2 hours, 8 minutes, 37 seconds. He was the first American man to win in three decades.

Police were deployed in force along the route, with helicopters circling above and bomb-sniffing dogs checking through trash cans. Officers were posted on roofs.

The two pressure-cooker bombs that went off near the finish line last year killed three people and wounded more than 260 in a hellish spectacle of torn limbs, smoke and broken glass.

Boston Marathon race director Dave McGillivray said it had been a long and difficult year.

“We’re taking back our race,” he said. “We’re taking back the finish line.”

A total of 35,755 athletes were registered to run — the second-largest field in its history, with many coming to show support for the event and the city that was traumatized by the attack on its signature sporting event.

“I can’t imagine the number of emotions that are going to be there,” said Katie O’Donnell, who was stopped less than a mile from the end last year. “I think I’m going to start crying at the starting line, and I’m not sure I’ll stop until I cross the finish line.”

Buses bearing the message “Boston Strong” dropped off runners at the starting line in the town of Hopkinton. A banner on one building read: “You are Boston Strong. You Earned This.”

Among the signs lining the end of the route was one paying tribute to 8-year-old Martin Richard, the youngest of those killed in the bombing.

“No more hurting people. Peace,” read the sign. A photograph of Martin holding a poster he made for school with those words was published after his death.

“I showed up, I’m back, and I am going to finish what I didn’t finish last year,” said Mary Cunningham, 50, of St. Petersburg, Florida, who was stopped a mile short of the finish line by the explosions last year.

Sabrina Dello Russo, 38, of South Boston, was running her first marathon for a good friend, Roseann Sdoia, who lost her right leg in the bombing.

“She is my inspiration from day one last year when I saw her in the ICU. Every run I do, she is in the back of my head, and she will be keeping me going today,” Dello Russo said.

While Gov. Deval Patrick said there had been no specific threats against the race or the city, spectators at the 118th running of the world’s oldest annual marathon had to go through tight checkpoints before being allowed near the starting and finish lines.

Fans hoping to watch near the finish line were encouraged to leave strollers and backpacks behind. Police set up checkpoints along the marathon route to examine backpacks, particularly outside subway station exits. And runners had to use clear plastic bags for their belongings.

More than 100 cameras were installed along the route in Boston, and race organizers said 50 or so observation points would be set up around the finish line to monitor the crowd.

Runner Scott Weisberg, 44, from Birmingham, Alabama, said he had trouble sleeping the night before.

“With everything that happened last year, I can’t stop worrying about it happening again. I know the chances are slim to none, but I can’t help having a nervous pit in my stomach,” Weisberg said.

Race organizers expanded the field from its recent cap of 27,000 to make room for more than 5,000 runners who were still on the course last year at the time of the explosions, for friends and relatives of the victims, and for those who made the case that they were “profoundly impacted” by the attack.

Kenya’s Rita Jeptoo won the women’s race in a course-record 2 hours, 18 minutes, 57 seconds, defending a championship from last year. She had been hoping this year for a title she could enjoy.

“It was very difficult to be happy. People were injured and children died,” she had said of last year’s marathon. “If I’m going to win again, I hope I can be happier and to show people, like I was supposed to last year.”

Other runners were expected to remain on the course for several hours after the winners crossed the finish line. Last year, the bombs went off at 2:49 p.m., as spectators crowded around the finish the line to cheer the still-arriving runners about five hours into the race.

Dzhokhar Tsarnaev, 20, is awaiting trial in the April 15, 2013, attack and could get the death penalty. Prosecutors said he and his older brother — ethnic Chechens who came to the U.S. from Russia more than a decade ago — carried out the attack in retaliation for U.S. wars in Muslim lands.

Tamerlan Tsarnaev, 26, died in a shootout with police days after the bombings.

One runner Monday, Peter Riddle, a 45-year-old Bostonian, said he suffered post-traumatic stress disorder from being at the finish line last year.

“I did a lot of talking this year, but running has helped me resolve a lot of things in my head,” he said. “Running the marathon this year and running down Boylston Street will help me find peace and help me move forward.”

Associated Press writers Jimmy Golen and Rik Stevens in Boston and Paige Sutherland in Wellesley contributed to this report.