Officers were alerted to the incident on Niddry Street, Edinburgh, at around 3.50am on Wednesday, June 8.
Armed police attended, and the 31-year-old male victim was taken to the Royal Infirmary of Edinburgh for treatment for serious injuries.
Edinburgh weather: Capital and the Lothians warned as Met Office predict thunderstorms to follow heat wave
West Lothian fire: Pictures show firefighters still battling West Lothian wildfire which broke out three days ago
Lothian bus driver ‘hit by stone’ as police launch witness appeal
Edinburgh festival 2022: Circus act involving Czechia and Ukrainian performers arrives at the festival
Edinburgh crime news: Here is a round up of the crime stories from the Capital and the Lothians this week
Three men, aged 32, 32 and 27, have now been arrested and charged in connection with the assault.
The suspects are due to appear at Edinburgh Sheriff Court today.