Actor Alec Baldwin has agreed to attend an anger management class to resolve a criminal case stemming from a skirmish over a parking space.

Baldwin, who was accused of striking another driver in the face during the November 2 dispute outside his New York City home, pleaded guilty to harassment and will have his case record sealed once he completes the one-day class.

The charge is a violation, the lowest level of offence.

A misdemeanour attempted assault charge was dropped.

Alec Baldwin leaves a New York City court
Alec Baldwin leaves court (Mark Lennihan/AP)

Prosecutors offered the compromise after reviewing video of the confrontation, looking at medical records and talking to the victim and witnesses, prosecutor Ryan Lipes said.

Baldwin, who has had various scrapes with the law over the years, has a clean criminal record, Mr Lipes said.

The 60-year-old, wearing a sport coat, black top and black framed glasses, spoke only a few words during the court hearing, mostly answering short questions from the judge.

Baldwin and his lawyer did not comment outside court, but the actor was not shy on Twitter, where he criticised the media for staking out his courtroom when there were more serious cases elsewhere in the building and for misreporting the allegations against him.

“The press reported that I punched someone. That is untrue, and that is a serious charge. A man was punched in NY recently and died,” Baldwin tweeted, along with a link to a news article about a fatal bar fight in Queens in November.

“Nothing that resembles justice ever enters or leaves any courtroom in this country,” he added.