The suspect, from the popular tourism resort of Palma de Majorca on the Balearic Islands archipelago in the Mediterranean, was detained after he voluntarily turned up at a police station to confess, the police said in a statement.
"Officers accompanied him to his home, where they found two freezers with bone and organic remains as well as sections of the body," they said.
Police said the man, whose name was not released, could not recall how many days ago the crime took place.
The suspect told police his 32-year-old brother had moved in with him about a year ago, leading to heated quarrels.
"In one of those arguments in the home, the brother took a hammer and tried to assault the detainee, who snatched the weapon and aimed several mortal blows at the (victim's) head," police said.
A police source said the victim had yet to be formally identified.