A Dunedin man has been sentenced to six years and nine months in prison for trying to kill his former girlfriend in a stabbing frenzy.

Greig O'Kane pleaded guilty to attempted murder earlier this year, after stabbing his then-partner 11 times at her Fairfield home in January.

The 40-year-old turned the knife on himself during the attack.

Justice Graham Lang handed down the prison sentence at the High Court in Dunedin this morning. O'Kane was also ordered to pay reparations of $5500 to his victim.