Tony Salvatore appeared at the High Court in Glasgow after pleading guilty to a charge of culpable homicide due to diminished responsibility.
The accused carried out the attack on his grandparents Denis and Mary Fell on Boxing Day in 2021.
The accused has been ordered to be detained without a limit of time at the State Hospital in Carstair under compulsion and restriction orders.
Moria Orr from the Crown Office and Procurator Fiscals Service empathised that “This was a brutal and senseless attack which has had a devastating impact on an entire family”.