A masked man pointed a weapon at a man in Ballykelly and pulled the trigger, police have said.
The firearm, however, jammed.
The victim was approached by three unknown men, one of whom was armed with a firearm, in the Kings Lane area at around 7.30pm on Sunday.
The suspects made off towards Drummond Park. The victim was left badly shaken but not injured.
All three males were wearing scarves covering their faces.
One of the men is described as 6”2 in height and wearing a black, hooded top with the second male described as wearing the same and around 5”10 in height.
The third male, who was armed with the gun, was described as being 5”6 in height and wearing a dark coloured hooded top and grey tracksuit bottoms.
Sinn Fein Councillor Dermot Nicholl condemned the incident.
He said: "Thankfully the man was not seriously hurt but it appears this was an attempt to kill or injure him.
“There is no place for guns in our society and those responsible for the attack must be taken off the streets and should face due process in the courts.
“I appeal to anyone with information to bring it forward to the police and assist the police investigation in any way possible.”
Detective Sergeant Wallace said: "I would appeal to anyone who may have been in the area and saw what happened, or anyone who has information which could assist our investigation, to get in touch with detectives at Musgrave on 101 and quote reference number 1956 of 11/07/20.”
"A report can also be made using the online reporting form via www.psni.police.uk/makeareport or by calling Crimestoppers anonymously on 0800 555 111 or online at www.crimestoppers-uk.org."