Even though the team lost, the Washington Nationals had reason for celebration on Monday night, clinching a division title for the first time in team history.

The Nationals lost to the Phillies 2-0, but clinched the division after the Atlanta Braves lost to the Pirates. It is the first division title since the team moved from Montreal to Washington after the 2004 season.

"The puzzle came together," 86-year-old Nationals owner Lerner said to the Associated Press. "A little earlier than we expected."

The Nationals are the first Washington team to make the playoffs in nearly 80 years and the team has a chance to finish with the best record in the major leagues.

Washington got contributions from all over the roster this season, including from Cy Young-candidate Gio Gonzalez, who had 21 wins this season. Gonzalez was acquired by general manager Mike Rizzo in the offseason from the Oakland Athletics for a group of prospects.

"This is incredible. The excitement. The joy. The fans. Smiles on everyone's faces, the excitement that's going on," Gonzalez said. "Everyone here just witnessed history. Hopefully we can try to continue that journey."

The team also got a phenomenal season from teenager Bryce Harper, who has hit 22 home runs, 26 doubles and scored 97 runs in his rookie season.

Washington wins the division it has been leading since May and ends a long period of playoff drought for the city. Although the team lost on Monday night, there was no disappointment in the clubhouse.

"The way it happened tonight doesn't really matter," said third baseman Ryan Zimmerman. "We put ourselves in that position to have the luxury of having the other team have to play perfect baseball. We played a great 159, 160 games to get to that point, and we should be commended for that."

Zimmerman was the Nationals first draft pick in 2005 and has been with the team every year since moving to Washington. He lived through tough times, including when the team lost 100 games in back-to-back seasons in 2008 and 2009. Until 2012, the team never had a plus-.500 record.

Washington was down 2-0 in the bottom of the ninth inning with Michael Morse batting when the Braves finished their game. The scoreboard in Nationals Park flashed: "NL East Division Champions" to the delight of the crowd.

The team has won a division title in franchise history, with the Montreal Expos winning in 1981, but it was the first since moving to Washington.

"I'll remember being in the scrum in the middle of the clubhouse with all the guys, just elated and all together," Rizzo said later. "We live with each other for seven months a year. Culmination of all that emotion and such a successful season for us."

The Nationals clinched a playoff spot on Sept. 20, bringing postseason baseball back to the city for the first time since 1933. The Washington Senators played the New York Giants in the World Series, but lost in five games.

Rizzo was instrumental in turning the team around. He drafter Harper and pitcher Stephen Strausberg, traded for Gonzalez and also signed Jason Werth as a free agent in 2010 to a $126 million deal.

"These guys have been through a lot. That just goes to show you it's not easy. It's not easy getting to this point," Werth said. "Luck plays into it a lot. You've got to be on good teams -- and I'm on a good team."

The Phillies had won the previous five NL East division titles and scored the only runs of the game in the second inning. Darin Ruf hit a triple off Washington starter John Lannan that scored Carlos Ruiz and Dominic Brown.

Kyle Kendrick pitched for the Phillies, going seven innings, allowing no runs and striking out four.

"Made me mad. Yes it did. Very much so. I'm a bad loser," Phillies manager Charlie Manuel said about watching Washington clinch against his club. "Nobody should be a good loser. I'm a bad loser and I always will be."