CARSON, Calif. — A year after Landon Donovan returned to soccer, he realized he had lost his passion for the sport again. This time, the best soccer player in American history decided to walk away for good.
The 32-year-old Donovan announced Thursday he will retire at the end of the MLS season, wrapping up the most prolific career in the league’s history with one last run at a championship with the Los Angeles Galaxy.
‘‘I think for the last few years, I haven’t had the same passion that I had previously in my career,’’ Donovan said. ‘‘To some extent, I had felt obligated to keep playing.
“It’s time to enjoy the rest of the season, and there would be no better way than to go out as a champion, so that’s what I want to do.’’
Donovan is the top goal scorer in MLS history and the top scorer in US national team history, excelling as a forward and a midfielder. He was even named MVP of his 14th MLS All-Star Game Wednesday night in Portland, scoring a goal in the All-Stars’ 2-1 win over Bayern Munich, only to make his stunning retirement announcement the next day.
‘‘All I could think is that if everyone only knew,’’ Donovan said with a grin.
Donovan, a five-time MLS champion with the Galaxy and the San Jose Earthquakes, made his retirement announcement on the same stage where he agreed to a multiyear contract extension with the Galaxy just a year ago, pronouncing himself revitalized after an extended sabbatical.
He took several months off following the Galaxy’s second straight MLS Cup title alongside now-retired David Beckham in December 2012. Donovan traveled extensively during his time off, and he plans to see even more of the world after his career ends this fall.
‘‘It gets me excited thinking about it,’’ Donovan said. ‘‘For 16 years, almost every decision I’ve made, every hour of every day, has revolved around, ‘How is this going to prepare me for tomorrow’s training session or tomorrow’s game?’ Just having the freedom to do whatever you want is exciting, and I’m looking forward to that.’’
Donovan has been a key component of MLS’s impressive growth during his 14 years in the top North American league. After he struggled for playing time at Bayer Leverkusen as a teenager, he chose to pursue a pro career in his native California instead of Europe, adding a marquee attraction to the then-struggling league.
‘‘There is no doubt that Major League Soccer would not be what it is today without Landon Donovan,’’ MLS commissioner Don Garber said. ‘‘His decision to join MLS in 2001 was a statement to the entire soccer community, at the most crucial time in our history, that MLS could be a league of choice for the best American players.
“Landon is to MLS what Michael Jordan was to the NBA, Wayne Gretzky was to the NHL, and Tiger Woods was to the PGA Tour — a player whose sporting accomplishments and popularity transformed their respective leagues and set a new standard for how the game would be played.’’
Donovan said his decision wasn’t spurred by his omission from his fourth US World Cup team this summer. He was surprised and disappointed by coach Jurgen Klinsmann’s decision, feeling he had done enough in training camp to warrant inclusion.
‘‘I certainly wasn’t going to allow one person’s poor choice this summer to affect a decision like this,’’ Donovan said.
Donovan is the career US leader with 57 international goals over 156 appearances, and he has scored five World Cup goals, including his famed stoppage-time goal against Algeria four years ago to send the Americans to the second round. He watched the American team in Brazil from afar as a television commentator.
‘‘Quite simply the best player ever to wear the USMNT jersey,’’ US Soccer Federation president Sunil Gulati posted on his Twitter account.
Donovan has no concrete plans for his longterm future in soccer, but he is eager to work with young players in the Galaxy’s academy training program.
‘‘Landon’s legacy is secure with the Galaxy,’’ said team president Chris Klein, Donovan’s former teammate and roommate. ‘‘So to be able to celebrate that for the rest of the year in terms of how he goes out will be great. When he decides what it is that he wants to do and where he wants to put his heart and energy next, we’ll be there to talk about that.’’
Donovan has played for the Galaxy since 2005, also going on loan to Everton and Bayern Munich during the Galaxy’s offseason. Donovan struggled early in his pro career in Europe, but was popular during his two stints with Everton.
‘‘Congratulations on a great career to @landondonovan as he announces he’ll retire later this year. Part of EFC fabric,’’ Everton tweeted from its official account.
Donovan has four goals and seven assists in 17 games for the Galaxy this season as a midfielder and a forward. He passed Jeff Cunningham for the career MLS goals record shortly after Klinsmann excluded him from the World Cup team.
His absence creates another hole for the LA club, which couldn’t manage a third straight MLS title last season in its first year since Beckham’s departure. But Donovan’s retirement opens up a designated player spot for the Galaxy alongside leading scorer Robbie Keane and US national team defender Omar Gonzalez.
After a lifetime spent in practices and games, Donovan sees his departure as another step in his personal evolution into whatever person he decides to be outside soccer. His decision to leave the Bundesliga for MLS as an unhappy teenager was unpopular, and Donovan knows many fans won’t understand his early retirement.
‘‘Sometimes there’s a sense of obligation in people’s lives, the sense that you have to do something,’’ Donovan said. ‘‘I’ve never lived that way. I have to live the life I want to live, and that’s an important thing to go by.’’