ROCKLIN (CBS13) — A former Whitney High School teacher was sentenced more than four years in prison and register as a sex offender for his relationship with a student

As part of the agreement, Matthew Scott Yamamoto of Rocklin pleaded no contest to oral copulation with a minor, attempted sexual intercourse with a minor and sexual penetration on a minor. He also pleaded guilty to one felony count of conspiracy to obstructing justice. Several related misdemeanor counts were also dismissed.

READ MORE: North Highlands Fire Leaves 11 People With No Place To Live

Yamamoto had faced a maximum of five years in state prison.

READ MORE: Just Keep Your Returns: Stores Weigh Paying You Not To Bring Back Unwanted Items

The judge opted for the sentence because of repeated violations of a restraining order imposed in the case, and the fact he taught the victim how to hide communications from authorities and destroy evidence.

MORE NEWS: At Least 1 Person Killed After Vehicle Crashes Into Tree Near Aubrun