Legendary has won a bidding war for rights to the China-set action movie “Skyscraper” with Dwayne Johnson attached to star.

Rawson Marshall Thurber is directing from his own script. Beau Flynn is producing through his FlynnPictureCo. with Johnson’s Seven Bucks Productions. Thurber will also produce.

Universal, Sony and Paramount also made bids for the project, which takes place in a massive skyscraper in China, with Legendary paying about $3 million. Details of the logline are being kept under wraps.

Universal will handle distribution of “Skyscraper” worldwide. Legendary was acquired four months ago by Chinese conglomerate Dalian Wanda for $3.5 billion.

Johnson and Flynn teamed on New Line’s “San Andreas,” which grossed more than $470 million worldwide, and on the two “Journey to the Center of the Earth” films.

Johnson will be seen next month with Kevin Hart in action-comedy “Central Intelligence,” which Thurber directed for New Line. Johnson recently wrapped shooting on “Baywatch” for Paramount.

Wendy Jacobson will oversee “Skyscraper” for FlynnPictureCo.

Legendary and Universal are partnered on the fantasy-adventure “Warcraft,” which is opening internationally starting this week and in China on June 8, and in U.S. two days later.

The companies are also producing another fantasy-adventure, “The Great Wall,” with Matt Damon starring and Zhang Yimou directing. The film will open in December in China and on Feb. 17 in the U.S.

Thurber also directed “Dodgeball: A True Underdog Story” and “We’re the Millers.”

Johnson is repped by WME and Gang Tyre. Thurber is repped by WME and Hansen Jacobson.