EDITOR'S NOTE: This article has been amended to include the name of the attorney who represented state Sen. Brian Pettyjohn in his Maryland court hearing.

State Sen. Brian Pettyjohn will not face prison time in connection with his arrest on a felony gun charge at a Maryland airport last summer.

Pettyjohn entered a plea agreement on Friday in which the felony charge of carrying a firearm on an aircraft was dismissed.

Under the deal, Pettyjohn agreed to serve 18 months of unsupervised probation on a separate misdemeanor charge of having a concealed handgun on his person, according to his attorney.

BACKGROUND:Delaware state senator charged with felony after gun found in airport carry-on

Pettyjohn has a license to carry a concealed weapon in Delaware, but not in Maryland.

The 43-year-old Republican from Georgetown was at the Salisbury, Maryland, Regional Airport on June 22 when a TSA agent found a loaded handgun in his carry-on bag.

Pettyjohn told reporters he was headed to a conference in New Orleans on an early flight and in his rush forgot to properly stow his 9mm handgun.

The weapon was discovered at a checkpoint X-ray machine and was not taken onto the plane.

"As I have said in the past, I’m not the first person who has made an honest mistake," Pettyjohn said in a release issued late Friday afternoon. "My family and I are happy that this is now behind us, and I look forward to continuing to work for and represent the people of the 19th Senate district."

Pettyjohn was facing a maximum sentence of 10 years in prison.

He pleaded not guilty in July and a trial had been scheduled to begin Oct. 31, according to Maryland's online court records.

By agreeing to a probation before judgment, Pettyjohn did not admit to any guilt and was not convicted of any crime.

So long as he stays out of trouble during his probation, the misdemeanor charge will be dismissed, said Maryland attorney John Phoebus, who represented the state senator in court.

As a part of the plea deal, Pettyjohn also reportedly turned his handgun over to the Wicomico County Sheriff's Office.

Contact reporter Scott Goss at (302) 324-2281, sgoss@delawareonline.com or on Twitter @ScottGossDel.