A Victoria man has pleaded guilty to second-degree murder in connection with a fatal 2017 shooting at a hotel in Nanaimo.

Brandon Tyler Woody entered his plea in a Nanaimo courtroom Friday and will remain in custody until his sentencing hearing.

Woody was charged in the shooting death of 34-year-old Andrew McLean in the lobby of the Howard Johnson Hotel on Terminal Avenue.

When the trial began in October 2018, he initially pleaded not guilty to first-degree murder. At the time, police said the shooting appeared to be targeted.

A trial with a jury was scheduled to begin next month, but in the interim, Crown prosecutors say Woody had a change of heart and pleaded guilty to the lesser second-degree murder charge.

His sentencing hearing will take place over three days in late March.

While a second-degree murder charge carries an automatic life sentence, the hearing will determine how long Woody's period of parole ineligibility will be.

Mounties said the fatal shooting was the first homicide in Nanaimo since a high-profile shooting claimed two lives at the Western Forest Products mill in 2014.