The man was walking home with another man in the Glencar area when he was set upon.
He was rushed to Letterkenny General Hospital but his injuries are not believed to be serious.
The men had been socialising earlier in the Glencar Inn but had left.
When they did so they were approached and attacked on the back road to Fair Green.
Gardai in Letterkenny have appealed for anybody with any information on the attack to contact them.