PHOENIX -- The Houston Astros are going to the playoffs for the first time in a decade despite ending the regular season with a 5-3 loss to the Arizona Diamondbacks on Sunday.

The Astros led the AL wild-card race by a game heading into Sunday. They shared a few high fives in the dugout in the eighth inning after clinching it when the Los Angeles Angels lost to Texas.

advertisement | advertise on newsday

Houston finished 86-76 to reach the postseason for the first time since playing the Chicago White Sox in the 2005 World Series. The Astros will play their first American League playoff game Tuesday night, against the New York Yankees at Yankee Stadium.

Not bad for a team that had three 100-loss seasons before going 70-92 in 2014.

Arizona went 79-83 in its first season under general manager Dave Stewart and manager Chip Hale, a 15-game improvement from finishing with baseball's worst record in 2014.