An alleged bid to kill a shooting victim was carried out in revenge for an earlier fight at the same house in Cookstown, the High Court heard on Monday.
A 35-year-old man was blasted in both ankles after two masked intruders forced their way into property in the Drumcree area last month.
Mark Hay, 32, of Beechway in the town, faces charges of attempted murder, threats to kill, aggravated burglary, and possession of a firearm.
He denies any involvement in the attack on June 5, insisting it was a case of mistaken identity.
Hay was refused bail, however, due to the risk of further offences being committed.
The court heard two men wearing balaclavas went into the house where a party had been held.
Robin Steer, prosecuting, claimed one of them was recognised before a woman removed Hay’s mask.
He alleged that the accused warned her: “Sit the f*** down or you’re getting shot next.”
Hay then walked forward and shot the victim in both ankles with a handgun, the prosecutor claimed.
Madam Justice McBride was told both intruders fled, being driven from the scene in a waiting car.
Disclosing the suspected reasons for the attack, Mr Steer said the victim had been in a fight earlier that day with the second, unnamed attacker.
“The other male received a black eye as a result of that; it appears to be a revenge attack for that,” he added.
According to the prosecutor both the shooting victim and the woman picked out Hay as being the gunman during an identification process. The weapon used has not been recovered.
Hay handed himself in to police on June 21, but insisted he was not involved.
During interviews he stated: “It wasn’t me, I was at my mother’s all day. This is a case of mistaken identity.”
Defence counsel Michael Forde argued that his client is not forensically linked, and questioned the reliability of the witness identification.
“There are live issues of collusion and contamination which will be dealt with if this matter goes to trial,” he told the court.
“The applicant’s case is quite clear: he did not fire the gun, he did not hold the gun, he simply wasn’t present.”
But denying bail based on concerns about possible re-offending, the judge said: “I’m not satisfied there are any conditions I could impose which would reduce or extinguish that risk.”
At an earlier hearing at Dungannon Magistrates Court, Judge John Meehan, also denied bail.
Judge Meehan said: “The defendant has a bad record for high levels of violence. The risk of interference with witnesses is acute, given this is a high violence offender.”
Hay was remanded to appear again by video on July 20.