Max, I am assuming you removed the impeller from the shaft? That should allow the shaft to come out the other side as it just slides into the bearings that are pressed into the case. If the shaft is stuck in the bearings, you can give the shaft a light tap with a rubber hammer to help break the possible corrosion holding it in place.
if you are unable to get the impeller off, then you will need to hold the shaft (generally the drive gear would have been enough. The impeller doesn't use much torque to tighten it, but it is usually installed with thread lock.