BANGKOK - Four men who brutally attacked a British family vacationing in Thailand have been sentenced to two years in prison for the assault, which was captured on video and widely shared on social media, officials said Monday.

The video showed Rosemary and Lewis Owen, both in their 60s, and their 43-year-old son getting punched in the faces, knocked down and kicked until they fell unconscious. The attack occurred April 13 attack in the seaside resort town of Hua Hin.

It was the latest blow to Thailand's image as a tourist haven and prompted officials to vow swift punishment for the attackers.

Get Breaking News Delivered to Your Inbox

"This should serve as an example," police Maj. Gen. Kasana Jamsawang said. "Let this be a reminder to people who might want to hurt others."

The Hua Hin provincial court sentenced the men May 23 but the penalties only became public over the weekend when the court transcript was released. The court sentenced the attackers to four years in prison but reduced the sentence to two years without parole because the suspects pleaded guilty, said Vichit Asakit, a duty officer at Prachuap Khiri Khan police station, which covers the Hua Hin area.

Hua Hin police stand behind two suspects, seated at table, Thursday, April 28, 2016, who were arrested following an assault on an elderly British couple and their son who were savagely attacked during a family vacation in Hua, Hin, Thailand on April 13, 2016. Hua Hin Police, AP

The four men - Chaiya Jaiboon and Siva Noksri, both 20, and Supatta Baithong and Yingyai Saengkam-in, both 32 - were charged with conspiracy to commit group assault, which carries a maximum penalty of 10 years in prison.

Police have said the attack started after the Owens' son accidentally bumped into one of the Thai men on a crowded street.

Rosemary Owen, 65, suffered a serious head injury that resulted in surgery to remove a buildup of fluid in the brain. Her 68-year-old husband and 43-year-old son both required stitches in the head.

(Warning: The below video contains disturbing images.)

Panadda Diskul, a minister in the Thai Prime Minister's Office, visited the couple in May in a Hua Hin hospital. Thai media reported that he apologized on behalf of the Thai government and promised the suspects would face trial.

He was accompanied by the Hua Hin police superintendent, the Hua Hin mayor and the provincial governor, Thai media reported. They presented the couple with fruit baskets, flowers and other gifts.

Police superintendant Col. Chaiyakorn Sriladecho said all alleged attackers apologized for what happened.

"The men say they are sorry and that they wouldn't have done this if they weren't drunk," he said.

In March, four French tourists were assaulted on the island of Koh Kut as they walked to dinner. They included a mother and daughter who were both raped.

Two British backpackers were murdered on the island of Koh Tao in 2014. Autopsies showed the couple, a young man and woman, had been severely beaten and the woman raped. Two Myanmar, or Burmese, migrants were convicted of the crime based on DNA evidence that rights groups say was questionable.