Updated

A man who climbed Trump Tower last summer in an apparent bid to meet then-Republican Presidential Candidate Donald Trump pleaded guilty Monday – but will avoid jail time.

Stephen Rogata, with the help of suction cups, made it up to the 21st floor of the New York City skyscraper before he was pulled in through a window by police.

PROSECUTORS: TRUMP TOWER CLIMBER HAD PRACTICED IT

At the time, the Virginia native said he climbed the building on Aug. 10 in an attempt to get a meeting with Trump, ABC 7 reported. He pleaded guilty Monday of reckless endangerment and disorderly conduct.

As part of a plea deal, Rogata must undergo mental health treatment for a year and stay away from Trump Tower and the president, among other conditions. Failure could result in jail time for up for one year.

VIDEO: OFFICER DESCRIBES GRABBING TRUMP TOWER CLIMBER

"This was a well-thought-out, planned stunt," Pierre Griffith, an assistant district attorney, had said during court proceedings in August, noting that Rogata waited until his parents went on vacation before driving from Great Falls, Virginia, to New York ahead of the climb.

Rogata's hourslong climb of Trump Tower was streamed live by various news organizations and bystanders who watched gleefully as he slowly ascended floor after floor using a harness and climbing ropes.

After he was arrested, Griffith said, Rogata told a police officer that he had practiced using the suction cups on a three-story building in Virginia, scoped out Trump Tower ahead of his climb and intended to get to the roof.

"I want to get a message to Donald Trump," he told a Secret Service agent at the hospital, according to Griffith. The content of the message was unclear.

The Associated Press contributed to this report.