He is in the best shape of his life for the new Baywatch movie, and Zac Efron was working out while the cameras rolled on Tuesday morning.

The 28-year-old completed a tough obstacle course, and revealed that it had taken him 'months of training' to get to that point.

Zac went shirtless, wearing just a pair of black shorts over his American flag swimming trunks, and was seen showing off his rippling torso and bulging biceps as he swung from some monkey bars.

Scroll down for video

Fighting fit: Zac Efron completed a gruelling obstacle course on Tuesday while filming Baywatch in Miami

He shared a photo to Instagram in which he could be seen navigating the course from a great height, without the aid of wires.

'Nothing like a little #NinjaWarrior training to start the day,' Zac captioned the action shot. 'Months and months of training for this moment.'

Tagging his co-star Dwayne Johnson, he added: 'Bring it on @therock let's do this ALL DAY baby! #Baywatch #nowiresneeded.'

As the cameras rolled, the pair were later seen taking part in a pull-up competition in front of a large crowd.

'Months and months of training for this moment': Zac made it look easy as he swung through the air

In seriously good shape: The actor showed off his rippling torso and bulging biceps in a pair of black shorts

King of the swingers: Zac expertly navigated some monkey bars on the obstacle course

A long time coming: The 28-year-old revealed that he had been training for several months

Move over Tarzan: The hunk was also spotted swinging from a rope for one scene

Zac has been filming the movie reboot of the popular TV show alongside The Rock, Kelly Rohrbach, Alexandra Daddario, Priyanka Chopra and Hannibal Buress in Miami since last month.

The High School Musical star is taking on the role of Matt Brody, which was made famous by David Charvet.

Meanwhile The Rock plays Mitch Buchannon (David Hasselhoff's character), Kelly is filling Pamela Anderson's shoes as CJ Parker, and Alexandra is portraying Summer Quinn (played by Nicole Eggert in the original TV series).

From a great height: This is the first time that Zac has been able to complete the course without a wire

He's got competition: The High School Musical star tagged his co-star The Rock in a picture, telling him to 'bring it on'

Peekaboo: Zac's American flag underwear peeked out of the top of his shorts

Taking David Charvet's place: He plays Matt Brody in the movie reboot of the popular '90s TV show

Where did that body come from?: Once a lanky teenager, the star is now in the best shape of his life

Priyanka, who was named Miss World in 2000 and is now fast becoming a big star in the acting world after landing the lead role on Quantico, is the movie's villain Victoria Leeds.

The film is due to be released on May 19, 2017, 28 years after the TV series first hit the air.

On set on Monday, a make-up artist who perhaps has the best job in Hollywood was seen applying bronzer to Zac's sculpted six-pack.

The cast also got a visit from Sacha Baron Cohen, who was dressed as his Nobby character from his latest movie The Brothers Grimsby.

Battle of the brawn: Zac and The Rock later took part in a pull-up competition as the cameras rolled

Cheering them on: The pair were joined by their co-stars and a group of extras who applauded wildly

Keeping up: Zac managed to provide the incredibly muscular Rock with a bit of competition

Let's hope they don't have to do too many takes: The duo were both seen wincing while navigating the bars

A long time coming: The film is due to be released on May 19, 2017, 28 years after the TV series first hit the air

When he took a break from filming, Zac spent some time hanging out with the comedian, and shared a photo to Instagram which showed him effortlessly lifting the 44-year-old into the air.

As well as working on Baywatch, Zac has three movies coming out this year, with the hotly anticipated Neighbors sequel due out on May 20.

The actor also stars alongside Adam DeVine, Anna Kendrick and Aubrey Plaza in the comedy Mike And Dave Need Wedding Dates, which hits cinemas on July 8, and opposite James Franco, Alison Brie and Bryan Cranston in The Disaster Artist.

Action men: For another scene, the pair were having a battle in the swimming pool

The best job in Hollywood: The previous day, a make-up artist was seen applying bronzer to Zac's sculpted six-pack on the set

Move over Pammie and Nicole: Kelly Rohrbach (L) and Alexandra Daddario star as CJ Parker and Summer Quinn respectively. Kelly is pictured last week, Alexandra is seen on Monday with The Rock