A man who hid in a barn, then slashed two people with a knife in a domestic incident in the northwest suburbs has been charged with attempted murder, police said.

Deputies and paramedics responded at 6:49 p.m. Saturday to a domestic disturbance in the 5200 block of U.S. 173 in unincorporated Richmond, according to the McHenry County sheriff’s office.

Two wounded people were found inside the residence, and Miguel A. Hernandez-Solorzano was outside being restrained by other family members, police said.

Witnesses said Hernandez-Solorzano had hidden in a barn until he saw one of the victims, then “came out with a knife and slashed that victim in the back,” a statement from police said.

“The second victim saw this occur and attempted to stop [him] and … Hernandez-Solorzano attacked that victim and a fight ensued…”

The first victim was taken to Centegra Hospital in McHenry with non-life threatening injuries; the other was taken to Condell Hospital in Libertyville with non-life threatening injuries, police said.

Hernandez-Solorzano, 32, was treated on the scene for facial injuries and arrested, police said. He has been charged with two counts of attempted murder and one count of burglary.

The Des Plaines resident is being held at the McHenry County Jail on a $5 million bond. He is next due in court on Wednesday in Woodstock.