Zayn Malik, Harry Styles, Louis Tomlinson, Niall Horan, Liam Payne outsold Gary Barlow's first new solo album for 14 years by a factor of more than two to one, denying him a place at the top of the charts.
In a video message posted on twitter, One Direction thanked fans.
Speaking as he stood alongside his bandmates, Liam Payne said: "Hi everybody. We just want to say a massive, massive thank you for making our album Midnight Memories number one. It's absolutely incredible."
He added: "I can't believe the reaction. It really does mean a lot. Thank you so much."
One Direction sold 237,000 copies of their third album in the last seven days, according to the Official Charts Company.
They overtook the year's previous fastest seller, Daft Punk's Random Access Memories, which recorded 165,000 sales in its first week in May.
Barlow's Since I Saw You Last entered at number two, depriving him of the chance to emulate his erstwhile Take That bandmate Robbie Williams, who topped the album chart last week with his latest release Swings Both Ways.
Barlow tweeted: "Thank you thank you thank you thank you #gbarmy ! What an amazing result on the charts ! Xxxxxx"
The top five was completed by Olly Murs' Right Place, Right Time, followed by Eminem's The Marshall Mathers LP 2.
Irish chart stars Boyzone, who are celebrating their 20th anniversary this year, entered at number six with BZ20.
Susan Boyle went in at number nine with her latest release Home For Christmas. Her first three albums went to number one, while her fourth peaked at number five so this could be her worst chart performance so far.
DJ Calvin Harris's collaboration with Alesso and Hurts entered the singles chart at number one.
The trio's new collaboration, Under Control, knocked Lily Allen's cover of Keane's Somewhere Only We Know off the top spot and down to number four.
Barlow matched his album chart placing with his single, Let Me Go, up one place to number two, while One Direction's Story Of My Life rose seven places to number three. Bastille's Of The Night took fifth place.