A man was beaten and arrested early Sunday morning after allegedly pulling a gun while he was supposed to be caring for several children.

Anthony Joshua Lamb, 25, is accused of reckless endangering, a misdemeanor which could land him in prison for up to a year.

Court documents say Lamb and a woman were supposed to be babysitting four children while a husband and wife were at a bar.

The husband told Casper police that while they were at the bar, his wife got five phone calls from the woman watching the children with Lamb, saying things like "get home" and "please hurry, he has a gun," according to the affidavit.

According to court documents, the husband said he and his wife arrived at the apartment to find Lamb standing in the hallway with a gun in his left hand. The husband reportedly said he was able to pull the gun from Lamb's hands and then hit Lamb in the face about six times.

Police were called at 12:36 a.m. in reference to a possible family fight, and the responding officer heard yelling and screaming as he approached the apartment.

The officer found the husband, wife, another woman and four children in the apartment. The children were reportedly all screaming and crying, and the two women were trying to leave the apartment with them.

Court documents say the officer was told there was no one else in the apartment, and the husband reportedly said "We are leaving." The officer said no one would be leaving until the investigation was finished.

The husband allegedly balled his fists and angrily said "That's not how this works." The officer ordered the husband into a corner, but the husband ran into another room.

The officer drew his taser and followed and saw the husband reach into the cushions of the couch and then quickly pull his hands out, according to the affidavit.

At that point, the officer calmed the husband down and then saw Lamb, who was bleeding "substantially" from his head, emerge from the hallway with his hands in the air.

The wife allegedly said "It's his fault, he had a gun," and the officer immediately handcuffed Lamb. He then conducted a safety sweep of the apartment, during which he found a  large puddle of blood in the southeast bedroom.

Court documents say the husband told police that he put the gun in the couch to keep it away from Lamb. He reportedly never saw Lamb point the gun at anyone, but Lamb was allegedly standing in the hallway in a threatening manner while holding the gun.

The wife reportedly told police that her husband, upon arriving at the apartment, told Lamb to "drop the gun" several times, but Lamb refused. When the husband began to disarm Lamb, the wife said she ran into the back bedroom to comfort the crying children.

The husband reportedly told police that he was so mad that he didn't remember whether he he hit Lamb with the gun or kicked Lamb, but he believed he acted correctly towards Lamb for endangering his children and being so intoxicated while he should be babysitting.

According to the affidavit, the wife said she couldn't believe she trusted the woman and Lamb to watch her children.

Police interviewed the woman who was watching the children with Lamb, and she allegedly said she never said anything about a gun when she called the husband and wife. She reportedly told police that she only said "Will you come home? He is being loud," in reference to Lamb.

Lamb was "extremely bloody and beaten," according to court documents, and was taken by ambulance to Wyoming Medical Center.

During a police interview at WMC, Lamb reportedly asked the officer what had happened about 10 times.

Lamb allegedly told police that he thought he drank two 40-oz. beers and possibly a shot of hard liquor, adding that he didn't remember much besides drinking and listening to music.

Lamb reportedly said he didn't remember ever having a gun and was not aware there were guns in his home. Court documents say two guns were found at the home and were logged into evidence.

Lamb was medically cleared from the hospital, arrested and taken to the Natrona County Detention Center.