(CNN) -- "Harry Potter and the Half-Blood Prince" made $22.2 million at its midnight showings Wednesday, setting a new record.
Actors are seen at the latest "Harry Potter" premiere on Sunday on the Gold Coast of Australia.
The figure was released by Warner Bros., the studio that produced the film. (Warner Bros., like CNN, is a unit of Time Warner.) The previous record was held by last year's Batman tale "The Dark Knight," which made $18 million at its midnight showings.
"Transformers: Revenge of the Fallen," which opened on a Wednesday in late June, grossed about $16 million in its midnight premiere, according to the trade paper Variety.
"Half-Blood Prince," the sixth movie in the series based on J.K. Rowling's seven Harry Potter books, had more than 2,700 sold-out screenings, according to MovieTickets.com. Watch fiery scene from movie »
The film had more than 1,500 midnight screening sellouts in the United States and finished as the No. 2 all-time movie for advance ticket sales at MovieTickets.com.
The film finished just behind "Star Wars: Episode III: Revenge of the Sith" in advanced sales.
"Harry Potter and the Half-Blood Prince" is showing at almost 4,300 theaters across the United States and Canada. The film is expected to gross more than $100 million this weekend and could match "Transformers" and "Dark Knight" by making more than $200 million total in its first five days.
The new movie reflects the growth of the characters: Harry (Daniel Radcliffe), the orphaned boy wizard who has been forced to take on responsibilities beyond his years; Ron Weasley (Rupert Grint), his best friend, who is finding depths of courage he wasn't aware of; Hermione Granger (Emma Watson), the bookish and indispensable member of their clan who has demonstrated key leadership qualities; and all the rest, preparing for the showdown with the arch villain Voldemort. Potter 101: A guide to Harry Potter »
Among the returning performers: Michael Gambon as Dumbledore, Alan Rickman as Snape, Maggie Smith as McGonagall, Robbie Coltrane as Hagrid and Ralph Fiennes as Voldemort. One addition is Jim Broadbent, who plays Horace Slughorn, a former professor brought back to Hogwarts. iReport.com: Fans camp out, share expectations
Despite the growing darkness, there's also a lightness to the new film, Radcliffe said. Unlike the previous two movies in the series, which were rated PG-13, this one is rated a more family-friendly PG.
"I think this film's funnier," Radcliffe said. "There are a couple of moments which I laughed out loud at."
CNN's Todd Leopold contributed to this report.