Attack had life-threatening consequences, court hears