A soldier was sentenced to seven months' jail by the High Court here today after he pleaded guilty to having a mobile phone containing an image of the Islamic State terrorist group's flag.

Judge Siti Mariah Ahmad ordered Corporal Mohd Azidi Said, 28, from the army college of Segenting Camp, Port Dickson, to serve the jail sentence from the date of his arrest on Aug 19.

Before handing down the sentence, Siti Mariah said the court took into account that Mohd Azidi had no previous convictions and the guilty plea had saved the court's time.

She said the court also took into account the mitigation that he had repented and realised that the ideology championed by the IS was contrary to the ideology of Islam.

"Therefore, a proper sentence is seven months' imprisonment from the date you were arrested," she said and also ordered his mobile phone to be surrendered to the police for disposal.

The offence was committed at Port Dickson Police Headquarters at 10.05am on Aug 19.

The charge under Section 130JB (1) (a) of the Penal Code carries an imprisonment for up to seven years or fine, and which forfeits his right over any of the material.

According to the facts of the case, Mohd Azidi started surfing the web on IS in Syria after he became interested in 'jihad' (holy war).

He then downloaded an image of IS flag on his Samsung mobile phone before being arrested by the police on Aug 19.

According to the forensic report, the image was related to the IS.

Earlier in mitigation, Mohd Azidi, who was unrepresented, said that he was the sole breadwinner for his family.

Deputy public prosecutor Wan Shaharuddin Wan Ladin appeared for the prosecution.