A man who broke into a Vancouver woman's home, bashed her head with a rock and raped her has been declared a dangerous offender and sentenced to an indeterminate prison term.

A B.C. provincial court judge made the rulings against Caleb Heaton on Monday morning in a Vancouver courtroom.

During hearings to determine if Heaton merited dangerous offender status, the court heard that he broke into the victim's home in March 2015 and smashed her head repeatedly with a rock.

Crown prosecutor Michaela Donnelly described how Heaton tied the woman's hands, shoved clothing in her mouth, pushed her down the basement stairs and raped her.

Donnelly went on to say that when the victim screamed for help, Heaton held a knife to her neck.

"The Crown says his behaviour on that day was brutal, and it showed a profound failure to constrain his sexual impulses," Donnelly said in a December 2016 hearing.

"He used gratuitous and unnecessary violence. His conduct was degrading. His violence was unprovoked and his acts can only be described as coarse, savage and cruel."

Heaton had previously pleaded guilty to aggravated sexual assault, unlawful confinement and breaking and entering.

He also has a criminal record in Ontario that includes 34 mostly property-related offences from 2010 until October 2014, after which he moved to Vancouver, where he started staying in shelters.

Heaton was also sentenced Monday to four months for a single count of escaping lawful custody, which will be served concurrently.