After being predicted to finish at the bottom of their division by many experts, the Oakland Athletics finished an improbable run on Wednesday, defeating the Texas Rangers 12-5 to win the American League West division on the last day of the season.

The team defied the odds this season and in this particular game, coming back from a 13-game lead in the division and four runs down on Wednesday to send the Rangers to the wild-card round.

"We knew this is a beast of a team we would have to beat, and to be able to beat them three games in a row and win the division on top of it, really it's a magical-type thing," manager Bob Melvin said.

The loss sent the Rangers to the wild-card round to face off against the Baltimore Orioles in a one-game playoff to see who will pay the number one seed New York Yankees.

The turning point of the game came in the fourth inning after an error by Josh Hamilton allowed two runs to score. Hamilton chased down a fly ball in center field that dinged off his glove, extending the inning for the A's, who scored four runs to take a 7-5 lead. They never gave it back.

"You can have all the experience as you want but when you run into a team that's hot, experience has nothing to do with it," Texas manager Ron Washington said.

The Athletics have been the best team in baseball during the second half of the season, erasing a five-game lead by Texas in the last week of the season. According to ESPN.com, the Athletics won their first division title in six years and the Rangers set a record for most days spent in first place without winning a division, losing out after 178 days.

The final game was symbolic for the entire Oakland Athletics season; it featured an improbable comeback and a team that simply wouldn't give up.

"It shows how important Game 162 is," Oakland's Jonny Gomes said. "I don't think it took 162 to games to check the character of this ballclub."

The Athletics took an early 1-0 lead off of a Brandon Moss double in the first, but quickly fell behind. Texas scored five runs in the third inning, starting off with Adrian Beltre's RBI single that scored Ian Kinsler. Michael Young hit an RBI double, David Murphy added an RBI single and Geovany Soto capped off the inning with another RBI single to open a 5-1 lead.

Oakland never got down on themselves and never gave up on the game. In the next inning the A's took the lead and never looked back.

Following a leadoff walk for Brandon Moss, Josh Reddick hit an RBI double before Josh Donaldson and Seth Smith added singles to bring the score to 5-3. With no outs and two men on base, Coco Crisp hit a two-run double to tie the game, setting up Hamilton's error.

Yoenis Cespedes hit a fly ball to center field that Hamilton couldn't handle, allowing Crisp and Stephen Drew to score to take a 7-5 lead.

"I just missed it, man," Hamilton said. "You guys have a hard time believing we can forget about it and move ahead. But that's what we get paid to do."

Derek Norris added an RBI single in the fifth and a solo home run in the eighth to push the lead to 9-5 before Oakland scored another three runs to put the game out of reach.

"Ever since Day 1 I've been here, it's been, the A's can't compete with the payroll, can't compete with this team or that team," Norris said. "We're better off if we're down. It just gives us the extra energy."

Grant Balfour entered the game in the ninth inning and closed the game for the Athletics, getting Young to fly out to center field for the final out.

"I'm glad there's not one tomorrow or Friday," owner Lew Wolff said. "I can relax and go home. I'm running out of underwear."

Texas pitcher Ryan Dempster, who was the team's prized acquisition at the trade deadline, was ineffective on Wednesday, only lasting three innings and giving up five runs on six hits. Derek Holland took the loss after relieving Dempster, giving up three more runs on just three hits with no strikeouts.

Oakland's pitching was stellar behind AJ Griffin, who gave up four runs in 2.2 innings. The Athletics bullpen combined to throw 6.1 innings, allowing no runs and only four hits. Rookie Evan Scribner earned the win after striking out two batters in three scoreless innings.

The Athletics looked to be in rebuilding mode before the season started, trading three skilled young pitchers to other teams. The team traded eventual 21-game winner Gio Gonzalez to Washington, closer Andrew Bailey to Boston and Trevor Cahill to the Diamondbacks.

The team also traded starting catcher Kurt Suzuki to the Nationals in the middle of the season, another typical sign of giving up on the season. But typical doesn't describe anything about the Athletics this year.

The team has the lowest payroll in baseball and according to ESPN.com, earned 14 walk-off wins on the year, the most in the major leagues.

"There hasn't been a lot of luck involved," said general manager Billy Beane, who received a celebratory pie in the face. "The one thing about baseball, when you play 161 games, you don't get lucky this late in the season. There have been a lot of adjustments on the fly."