Two men have been charged after a man was shot in the leg at a unit complex in Sydney’s west.

Emergency services were called to a complex on Charles Street, Liverpool, about 12.40pm on Tuesday following reports of a shooting.

Officers from Liverpool City Police Area Command attended and found a 32-year-old man suffering from a gunshot wound to his leg.

He was treated at the scene by NSW Ambulance paramedics before being taken to hospital for further treatment.

Police established a crime scene as detectives began investigating the circumstances surrounding the alleged shooting.

Following inquiries, officers arrested two men, aged 39 and 44, at a hotel in Strathfield about 1pm on Thursday.

The 39-year-old man was taken to Auburn Police Station and charged with accessory after the fact to discharge firearm with intent to cause grievous bodily harm.

He was refused bail and is due to appear before Burwood Local Court on Friday.

The 44-year-old man was taken to Bankstown Police Station and charged with discharge firearm with intent to cause grievous bodily harm.

He was also refused bail and is due to appear before Bankstown Local Court on Friday.

Investigations into the incident are continuing.