A blaze broke out inside the UK Warner Bros. studio where all of the Harry Potter movies — as well as several James Bond flicks — were filmed, local authorities said.

The inferno broke out Wednesday night at one of the stages at the studios — in Leavesden, Hertfordshire, about 22 miles northwest of London — and lasted well into Thursday morning, the Hertfordshire County Council said in a statement.

Authorities brought in 18 fire engines, three jets and an aerial ladder platform to battle the flames, the council said.

The studio — where Anne Hathaway’s new movie “The Witches” is being filmed — was not being used at the time of the fire, and no one was injured.

The building was originally an aircraft factory used during World War II. In 1994, it served as the filming space for the James Bond film “GoldenEye.” At that time, it was known as Leavesden Film Studios.

It was then used for the first of the Star Wars prequels, “The Phantom Menace,” and later, Tim Burton’s “Sleepy Hollow.”

The Harry Potter franchise started filming there in 2000, with each of the franchise’s films based there over the next 10 years.

In November 2010, Warner Bros. completed its purchase of the site and announced plans to invest more than $125 million in the facility. The purchase sealed the company’s status as the only Hollywood film studio with a permanent base in the United Kingdom.

Recently, the studios have been used for the filming of “Paddington 2,” “Wonder Woman” and “Spider-Man: Far From Home,” according to IMDb.

The facility is also home to the “Making of Harry Potter” studio tour. A Twitter page for the tour confirmed Thursday that the blaze occurred at a site separate from the tour, which is “unaffected and operating as normal.”

Last month, a crew member for “The Witches” was assaulted at the studios. The incident originally was reported as a stabbing, but later appeared to be less serious than first thought — with the alleged victim suffering “a small laceration to his neck” during a confrontation with someone he knew.