Team GB went into the game knowing a draw would be enough for them to join the women in the semi-finals and the 1-1 draw turned out to be just enough.
The match was as close as expected, with the best chances arriving from penalty corners. Britain missed one inside the first seven minutes through James Tindall before Xavi Lleonhart saw his also deflected away by the keeper.
Just three minutes before the interval GB scored the vital opener, Ashley Jackson firing in from a penalty corner to lead 1-0 at the break.
The second half followed in the vein of the first, with both teams evenly matched and Britain were so close to going 2-0 up on 53 minutes as Jackson's shot was saved with Tindall hitting the post from the follow-up.
A minute later Spain were level, Pau Quemada converting a penalty corner on 55 minutes to set up a nervy final 15 for the hosts.
There were four more penalty corners inside the last few minutes but Britain defended well and held on for the point and second place in the group.