RICHMOND, Maine — A 60-year-old man charged in March with setting fires in a vacant home and a barn where he was staying has pleaded guilty to one count of Class A arson, among other charges, and under terms of a plea agreement, a second count of arson and burglary were dismissed.

Gary J. Martin, whose address is not listed but who was staying inside the barn, was charged by the state fire marshal’s office with setting the March 27 fire in a grill inside the barn. The fire did little damage to the barn, Maine Department of Public Safety spokesman Stephen McCausland said at the time. Police said they found evidence of previous fires in the barn, which they suspected him of setting, but McCausland said none caused much damage.

Martin also was charged with Class A felony arson, as well as burglary, aggravated criminal mischief and violation of condition of release related to a March 20 incident in a vacant home in Richmond.

Martin pleaded guilty in July to Class A arson, as well as misdemeanor charges of criminal trespass, criminal mischief and violation of conditions of release, for the March 27 barn fire, Sagadahoc County Deputy District Attorney Jonathan Liberman said Tuesday.

Under terms of a plea agreement in a separate case related to a March 20 burglary of a vacant home in Richmond, charges of arson and burglary were dismissed and Martin pleaded guilty to misdemeanor criminal mischief — reduced from aggravated criminal mischief — and violation of conditions of release, according to Liberman.

Martin is scheduled to be sentenced on Sept. 7 in West Bath District Court.