A man from Faribault, Minn., was charged Tuesday with attempted murder in the shooting of another man at a Bloomington motel, according to the Hennepin County Attorney’s Office.

Matthew Thomas Poncelet, 25, was charged with one count of attempted second-degree murder and two counts of second-degree assault. He is expected to make his first court appearance Wednesday.

Bloomington police were called Sunday to a hospital in Faribault, where doctors were treating a man with a bullet wound in his leg, according to the complaint. The victim told police that he had texted a female friend to see if she wanted to get together. He received a text back from her phone telling him to join her at her hotel room at the Best Western near the Mall of America in Bloomington.

When he arrived at the motel, he received another text message saying the door to the room was open and to come in, according to the criminal complaint.

The man went to the room and saw that someone was in the bed, but it was dark, so he looked for a light switch. As he did so, Poncelet hit him several times, according to the complaint. The victim ran from the room and, as he was fleeing down the hall, he heard a gunshot and felt something hit his leg, the complaint states.

Bloomington police went to the motel and grabbed Poncelet as he tried to go out the window. They later recovered a Sig Sauer .380 handgun hidden in his car, the complaint said. The woman, who was also in the motel room, told them that Poncelet is her boyfriend and that the victim also is her friend. She said that after she went to bed, Poncelet had taken her cellphone and sent text messages to the victim to lure him to the room, an account verified by other witnesses, according to the complaint.