A Bangor father was arrested Friday after he allegedly locked his 2 1/2-month-old child in a car in 70-degree weather while he visited a friend on Griffin Road.

Isaiah Olson, 24, is charged with child endangerment, a Class D crime, and taken to the Penobscot County Jail. Olson pleaded not guilty to the misdemeanor charge Monday when he appeared before a judge remotely at the Penobscot Judicial Center.

District Court Judge John Lucy set bail at $250 and ordered that the defendant have no contact with his child while the case is pending.

Police were called to an apartment complex about 6:50 p.m. Friday. When the officer arrived, he saw a baby crying and sweating locked inside a car, according to the Penobscot County District Attorney’s office. The office called a local towing company and an employee of the firm arrived about 20 minutes later, Assistant District Attorney Shelly Okere told the judge. Once the car was unlocked, the officer determined that the infant was not properly buckled into the car seat.

The Maine Department of Health and Human Services is involved in the case, according to the district attorney’s office.

Olson allegedly told police that he had been checking frequently on the child whom he thought was sleeping. He came out of an apartment as the tow truck arrived, Okere said.

He is next due in court on Oct. 4. If convicted, Olson faces up to a year in prison and a fine of up to $2,000.

Correction: An earlier version of this story misnamed the assistant district attorney involved in this case.