CHICAGO (AP) -- The Chicago Cubs' misery now stretches to 104 years and the Houston Astros will depart the National League with a whimper.
Obviously there's no winner in a season finale between a pair of 100-loss teams.
Bryan LaHair homered and hit the winning single in the ninth inning, and the Cubs beat the Astros 5-4 Wednesday in Houston's final game before switching to the AL next season.
In the first series between 100-game losers in the major leagues since 1962, LaHair homered in the second and broke a 4-all tie in the ninth against Hector Ambriz (1-1).
"I was pretty psyched up about today's game," LaHair said of his rare start. "I talked to my grandma last night and I wanted to get one more (home run) for her. Luckily, I did. It was a good feeling right there."
The 29-year-old LaHair held down the starting first base job through much of the first half after spending most of the previous nine seasons in the minors. His story reached its peak when LaHair was selected to the NL All-Star team, but his playing time dropped drastically once prospect Anthony Rizzo was called up in late June.
"To go through the adversity he's had to go through after having a great start, the All-Star game, then obviously losing a lot of playing time, it was a great finish to his year," Cubs manager Dale Sveum said. "The best way you can finish a season is be at home and have a walk-off win."
The Cubs, who last won a World Series in 1908, went 61-101 for their most losses since dropping 103 games in 1966.
"A lot of hard work was put in this year," LaHair said. "Unfortunately, the record didn't say that, but just to finish the season with a win, it's always fun to do that."
Carlos Marmol (3-3) pitched a scoreless ninth to earn the win.
Cubs starter Travis Wood allowed one run, three hits and five walks in 6 1-3 innings, giving up Carlos Corporan's RBI single in the first. Wood also chased Astros starter Edgar Gonzalez with a two-run single.
Houston went 55-107 and set a club record for losses with one more than last year. The Astros became the first team with 106 or more losses in consecutive seasons since the 1964-65 New York Mets.
Houston finished its NL tenure with 3,999 regular-season wins, 4,134 losses and five ties. The Astros are moving to the AL West next season, creating three divisions of five teams in each league.
The Astros were 16-25 under interim manager Tony DeFrancesco, who took over after Brad Mills was fired on Aug. 18. Washington third base coach Bo Porter already has been hired as Houston's manager for next season.
"It's going to be a game I'll always remember," DeFrancesco said of his last gig at the helm of the Astros. "I just went around to everybody and thanked them for everything they did. I appreciate it. They're ready to go home. It's been a long season."
Justin Maxwell hit a tying, three-run homer for Houston in the eighth off Shawn Camp.
Gonzalez gave up four runs, five hits and four walks in 3 1-3 innings. Houston pitched 28 consecutive scoreless innings before LaHair's homer in the second.
Most of the Cubs' regulars were given the day off. The exception, Starlin Castro, became the first player in franchise history to play shortstop in all 162 games, and the first major leaguer to do it since Philadelphia's Jimmy Rollins in 2007. Castro's 195 consecutive games played is the longest active streak in the NL.
NOTES: The Cubs dismissed third base coach Pat Listach after the game. . Chicago drew 2,882,756 fans to Wrigley Field, the first time under 3 million since 2003. ... Cubs OF Alfonso Soriano said he is open to being traded in the offseason if the Cubs don't plan on contending the next two years. "I just want to have one more shot to go to the World Series before I (retire)," Soriano said. The 36-year-old said he will seriously consider retiring when his contract expires after the 2014 season. He is slated to make $18 million each of the next two seasons.