Newcastle University said the killing of its students Neil Dalton and Aidan Brunger, both 22, was a "huge shock".
Malaysian police said the men were killed at about 04:15 local time on Wednesday.
There had been an argument between a man and one victim before the killings, and four men have been arrested over the murders, police added.
Mr Dalton, from Ambergate, Belper in Derbyshire, and Mr Brunger from Hempstead, Gillingham in Kent, were in the final week of a six-week work placement at a hospital in Kuching, a city in one of the two Malaysian states on the island of Borneo.
In a statement, Malaysian police said the two victims had a drink in a tea shop, where one man rebuked them for being noisy.
"This gave rise to an argument," police said, between the man and one of the victims before they left the shop.
Police said four men then pursued the students in a car, before one man got out and attacked them with a knife.
The police added three suspects were arrested at about 06:00 local time and a knife was also found, and a fourth suspect was arrested at 16:45.
"The case is being investigated under Section 302 of the Penal Code which carries the mandatory death sentence upon conviction," the police statement said.
The area is said to be known for its popular nightlife among tourists.
Police said Mr Dalton and Mr Brunger had been due to complete their placement in Kuching on Friday.
Professor Tony Stevenson, acting vice-chancellor of Newcastle University, said: "We were informed this morning of the very sad news that two of our fourth year medical students working at a hospital in Kuching, Borneo, have been tragically killed.
"Neil Dalton and Aidan Brunger, both 22, were on a six-week work placement along with five other medical students to put the skills they had learnt during their time here at the university into practice.
"This has come as a huge shock to us all and our thoughts are with their families and friends at this very difficult time.
"Two of our members of staff are flying out to Kuching as soon as possible and we are working closely with the British High Commissioner to support the other students and to co-ordinate their return to the UK."
The Foreign Office said it was aware of the deaths of two Britons and was "providing consular assistance to their families at this difficult time".

Dubbed "swirl face" due to efforts he made to disguise himself, Neil is classed a "high-risk sex offender".
The 42-year-old Canadian was arrested in Thailand in 2007 following a global manhunt and a worldwide appeal for public information by Interpol.
He has spent time in jail in both Thailand and Canada for sexually abusing young boys.
Corrections officials from the province of British Columbia (BC) issued a public warning following Neil's release on Sunday.
BC Corrections spokeswoman Cindy Rose said in a statement that Neil will be "subject to an intensive level of monitoring and supervision in the community".
It includes:
Neil was arrested 10 years ago when Interpol, the international police agency, appealed for help after experts unscrambled his digitally-swirled internet photos.
It was the first time Interpol had made a direct worldwide appeal for public information in a case.
Online images of Neil showing him abusing young boys had been manipulated to disguise his face with a swirl pattern, but German computer specialists were able to produce identifiable images.
Neil was jailed in Thailand between August 2008 and September 2012 following a conviction for sexual offences against two boys.  He was released and deported to Canada.
In December 2015 he pleaded guilty to five new charges involving the sexual abuse of young boys in Cambodia and possession of child pornography in Canada.  His sentenced was reduced due to time already served.
Neil, originally from Maple Ridge, BC, had spent about 15 years in Asia teaching English.
Two British medical students have been stabbed to death in Borneo, local police have said.
[NEXT_CONCEPT]
Convicted paedophile Christopher Paul Neil has been released from custody and will settle in Vancouver.