The incident happened around 22.45 on Sunday, 30 April, near the fountain in the High Street area of the town of Elgin
A 25-year-old man was taken to hospital with serious injuries.
The two boys, aged 14 and 15, have been arrested and charged in connection with the incident.
A report will be submitted to the Procurator Fiscal and they are expected to appear before Elgin Sheriff Court at a later date.
Detective Inspector Andrew Wilson said: “We are very grateful for the support and co-operation of the local community while we carried out our investigation into this incident.”
More news from Elgin