A standoff Wednesday morning between police and a Randolph man in a house 100 yards from Teresa C. Hamlin School ended within an hour with no injuries.

A man in a house on Second Street threatened to use a shotgun if Kennebec County sheriff deputies entered after he told his wife he wanted to commit suicide by cop, said Ryan Reardon, chief deputy of the Kennebec County Sheriff’s Office.

Classes at T.C. Hamlin, which has about 105 students in pre-kindergarten through fifth grade from Pittston and Randolph, were canceled for the day when the standoff was first reported.

The man’s wife called the sheriff’s office around 7:15 a.m., saying that the man was holding a knife to his throat and was threatening to kill himself, Reardon said. After the man barricaded himself in a bedroom, the woman and two children, ages 4 and 9, left the house and got into a car in the driveway, Reardon said.

The man, whose name was not released, told police who reached him by phone that he had a loaded shotgun and would use it if they entered the home, Reardon said. Eventually, they talked him out of it, and deputies took the man into custody, Reardon said.

A knife was found, but no shotgun, Reardon said. The standoff ended around 8 a.m.

The man was taken to MaineGeneral Medical Center in Augusta for an evaluation.

“This ended in the best way possible,” Reardon said. He said the school district also made the right call to cancel school, because it reduced the number of people who could have been hurt.

Reardon said several charges are possible, including creating a police standoff. He said he will release the man’s name only if he is charged. He said the sheriff’s office has to review what happened to determine whether the incident met the thresholds of any charges. Creating a police standoff is a civil violation.

Pat Hopkins, superintendent of Gardiner-based Regional School Unit 11, said the school district heard from police that the school’s street was shut down while buses were picking up students, so the district sent the students to Pittston Consolidated School.

After hearing it was a standoff that could take a number of hours to resolve, the district canceled school for T.C. Hamlin students, she said. By the time the district heard the standoff had ended, the school already had begun notifying parents that school was canceled, Hopkins said. Classroom teachers called the parents of the students in their classroom, and the district sent out an automated message by telephone informing parents of the situation and why school was canceled, she said.

Hopkins said it’s not possible to take students to another school without planning and still make the day meaningful and productive for all students. Because the rest of the district’s schools remained open, T.C. Hamlin students won’t have to make up the day, she said.