The tablet market has now declined year-over-year for 13 quarters straight. Q4 2017 saw a 7.9 percent year-over-year decline: 49.6 million units shipped worldwide, compared to 53.8 million units in the same quarter last year. The only silver lining is that declines for 2017 haven’t been in the double-digits, like they were in 2016.

The estimates come from IDC, which counts both slate form factors and detachables, meaning tablets with keyboards included. Apple maintained its top spot for the quarter, but Amazon for the first time managed to surpass Samsung for second place. The top five vendors accounted for 69.6 percent of the market, up from 61.3 percent last year:

Apple’s shipment numbers were basically flat, but because the overall tablet market declined, the company’s market share grew again (up 2.3 percentage points) after two quarters of growth (and following a 13-quarter losing streak). The company was able to maintain its lead thanks to its lower-priced iPad and refreshed iPad Pro.

Amazon shipped 2.5 million more tablets, gaining a massive 6.0 percentage points. The holiday quarter is typically the company’s strongest, but this year was a standout as the company managed to steal second from Samsung. IDC explains this was possible thanks to steep discounts as well as the fact Alexa is available on Amazon’s latest tablets.

Samsung shipped 1.0 million fewer tablets than in the quarter a year ago and ended up losing 0.8 percentage points. Detachable tablets accounted for a growing number of devices in its portfolio, but those gains were outweighed by the declines among its slate models, according to IDC. Its lower-cost Tab A and E series will be a challenge to replace as vendors promise better value and the market shifts to detachable devices.

Amazon wasn’t the only one who managed to move up in the tablet market. Huawei overtook Lenovo for fourth place (yeah, those are typos in the table above and below). Huawei gained 1.2 percentage points while Lenovo fell 0.4 points as they both still shared about 3 million units each.

For the full year, the same players were in the top five:

This isn’t a huge surprise given that the same tablet trends ran throughout 2017. Namely, the replacement cycle for tablets is still closer to that of traditional PCs than smartphones, and detachable tablets is the only category seeing growth, which is good news for both Apple and Microsoft.

“To date, much of the trajectory of the detachable market has been attributed to Microsoft and Apple pushing their wares in the U.S.,” IDC research analyst Jitesh Ubrani said in a statement. “However, continued success of this category hinges on the willingness of other PC vendors to participate and more importantly, consumers from other countries to adopt the new form factor over convertible PCs.”