Two men were arrested in connection to a home invasion gone violently wrong in Brookline on Wednesday. 

Antonio Brown Jr., 27, of Cambridge and Khari Wilcox, 18, of Dorchester were charged with armed home invasion, armed assault in a dwelling, attempted robbery, attempted murder and possession of an illegal firearm, according to Brookline Police Chief Daniel O’Leary.

The two were arrested in their hospital rooms, where they are being treated for stab wounds and a gunshot wound. 

O’Leary said that four men broke into an apartment at 198 St. Paul St. late Wednesday morning to rob a targeted occupant. He said that drugs may be a factor. 

RELATED: Brookline Police seek suspects in white Ford after shootings, stabbings

The occupant fought off the attackers, stabbing both Brown and Wilcox, and shooting one of them. The occupant suffered several gunshot wounds to the leg, O’Leary said, though it is not clear who shot him. All three men are in stable condition. 

The four men fled the scene in a rental car that was stolen from Cambridge. The two injured men bailed out at 75 Harvard St.. Boston Police found the stolen car near Symphony Hall on St. Botolph St. 

The two uninjured men are still on the run.

The incident prompted three Brookline schools to go on lockdown for several hours.