Arlington, Texas: Daniel Mengden struck out eight, Khris Davis hit his career-best 43rd homer and the last-place Oakland Athletics ended the season with a 5-2 win at Texas on Sunday.

The Athletics (75-87) finished at the bottom of the AL West for the third consecutive season, a franchise first, but won six more games than last season thanks to 17 victories in their last 24 games. Manager Bob Melvin even got a contract extension this week, adding a year through 2019.

Texas didn’t have a base runner against Mengden (3-2) until Adrian Beltre’s 3,048th career hit, a single leading off the fifth. Mengden walked one and allowed only four singles in his seven innings.

Blake Treinen worked the ninth for his 16th save in 21 chances.

After winning the AL West title the past two seasons, the Rangers (78-84) slipped from 95 wins last year.

Oakland went ahead to stay after four consecutive hits to open the third off Cole Hamels (11-6). Dustin Garneau and Marcus Semien had singles before Matt Chapman’s RBI double. Jed Lowrie followed with his 49th double, extending his single-season team record while driving in two runs.

Davis, already only the second A’s player other than Jimmie Fox (1932-34) with consecutive 40-homer seasons, went deep in the eighth. Davis hit 42 homers last season.

The Rangers didn’t score until Nomar Mazara’s two-run single in the eighth, giving him 101 RBIs. Beltre played for the first time since Tuesday, the night the Rangers were eliminated from wild-card contention. He missed only two weeks after a Grade 2 strain of his left hamstring Aug. 31, but was back two weeks later and was the DH in 13 consecutive games when the team still had a chance to make the play-offs.

After being lifted for a pinch-runner, Beltre got an extended ovation from the crowd that included a curtain call. The 38-year-old third baseman, who hit .312 in his 20th major league season, is signed with the Rangers through next season.

Hamels struck out five in his three innings. The lefty, who missed more than seven weeks because of a right oblique strain, ended the season with 148 innings — his fewest since 132 1/3 innings as a rookie with Philadelphia in 2006. He had thrown at least 200 innings each of the past seven seasons.