The 22-year-old still denies the crime but his lawyer says he did it to avoid losing his scholarship.

A Vietnamese student in Singapore has been sentenced to 16 weeks in jail after an investigation found that he had hacked into his professor's account and made changes to his grades.

A court in Singapore heard on Wednesday that Tran Gia Hung, 22, a first-year business management student at Singapore Management University (SMU), changed his grade for a final examination from D+ to B and his "Final Adjusted Grade'' from B to A-, before downgrading his classmates, Straits Times reported on Thursday.

According to the report, Hung is an ASEAN scholarship holder at SMU and the incident was discovered last year.

Investigators said Hung got his professor’s password by sitting near him in class and watching him typing the password before figuring it out through trial and error.

In April last year, the professor uploaded his students' grades for “Technology and World Change” and “Business Government and Society” into the school’s system and was about to release the results when he noticed the differences.

He reported the case to the university and the grades were held back. Following an internal investigation, the school linked the changes to Hung, but the Vietnamese student denied committing the crime, claiming that he had been framed by his roommates, according to Straits Times.

On April 29, four days after the incident, Hung had his laptop cleaned by an IT shop at a local shopping mall in Singapore.

The university asked the police to step in May last year and their investigation revealed that there were seven unauthorized log-ins to the professor’s account on the school’s system during March.

The investigations also found that Hung had also logged in from his home on April 25, the same date the students' grades were changed.

Hung was arrested in August last year but repeatedly denied the charges.

However, his lawyer said his client had committed the crime because he had been warned he would lose his scholarship if his grades did not improve.

The ASEAN scholarship is a annual program run by Singapore's government for students from other members of the regional bloc.