The violence occurred about 2.30am at the entrance of Wat Lat Sanum in tambon Khu Khot of Lam Luk Ka district.
It was reported to police, who rushed to the scene along with doctors from Bhumibol Hospital.
They found the dead body of Thanarat Jaengtai, who had been stabbed three times - in the back, the right cheek and the right hand. His friend, identified only as Pete, had a badly bruised face.
Pete told police that he was taking Thanarat on his motorcycle from an air force housing village to his home in Khlong Luang district.
In front of Wat Lat Sanun, they were stopped and beaten up by a gang of nine teenagers riding on three motorcycles. After the attackers fled, he found out Thanarat was badly hurt. He called for help but Thanarat died shortly after, before help arrived