A Democratic candidate for West Virginia’s State Senate who was beaten up at a barbecue last weekend said that he suspected the attack had been politically motivated but that he still hoped to leave the hospital in time to publicly watch the results of the state primary election on Tuesday.

The candidate, Richard Ojeda, said by phone from his hospital bed in Charleston that he had been kicked in the head until he passed out at an outdoors campaign event by a man he had known as a child, leaving him with fractured bones in eight places — including his eye socket and jaw — and stitches, bruises and swelling.

A suspect, Jonathan Porter, turned himself in to state troopers late Sunday and was booked on felony charges, including malicious assault and destruction of property, according to a law enforcement official.

Mr. Ojeda said he believed the attack was politically motivated because he had been “questioning leaders” and publicly calling out entrenched nepotism that he said had resulted in favoritism in jobs and salaries.