PITTSBURGH (AP) -- The Pittsburgh Pirates clinched the home field in the NL wild card-game, beating the Cincinnati Reds on Sunday behind J.A. Happ's stellar outing and Pedro Alvarez's long homer.
The Pirates (98-64) locked up the right to host the Chicago Cubs (97-65) Wednesday night in a winner-take-all playoff, with a victory on the final day of the regular season.
Despite having the second-best record in the major leagues, the Pirates finished second to the St. Louis Cardinals in the NL Central. Pittsburgh will host the wild-card game for the third straight year after beating Cincinnati in 2013 and losing to the San Francisco Giants last season.
The Pirates had 20 straight losing seasons, the longest streak in major North American professional sports history, before their current run of postseason appearances.
The Reds, who snapped a 13-game losing streak on Saturday night, finished 64-98 and last in the Central. That is their most losses since 1937 when they went 56-98, and their first last-place finish since 1983.
Happ (11-8) gave up three hits in six innings. He struck out seven and walked two while improving to 7-2 in 11 starts since being acquired July 31 from the Seattle Mariners.
Joakim Soria, Tony Watson and Mark Melancon finished the six-hitter with one scoreless inning each.
Alvarez's 479-foot leadoff home run to center field in the fourth inning, his team-high 27th, made it 2-0 after Josh Harrison doubled in the first and scored on Neil Walker's single.
Harrison and Francisco Cervelli each had three of the Pirates' 13 hits and Jordy Mercer had two.
Back-to-back doubles by Cervelli and Mercer in the sixth and Gregory Polanco and Harrison in the seventh padded the Pirates' lead.
Rookie Josh Smith (0-4) remained winless in seven career starts as he gave up two runs and seven hits in four innings with four strikeouts and no walks. Rookies started each of the Reds' last 64 games and 112 overall, both major league records.
Reds third baseman Todd Frazier had two hits.
Open the 2016 season against the Philadelphia Phlllies on April 4 at home. The Phillies (63-99) and Reds had the two worst records in the major leagues this year.