Thinking it must have been connected to an old hot water tank?
The pipe has a stopper at one end and then goes to a valve and pipe going through the floor of the flat above and below.
All of the joints a seized and not budging with the spanner - is there any danger in just cutting the thing off?