Back wheel lock up, when got off wheel would move side to side
If the wheel wobbles in the frame (and the QR or through axle is tight), or with the wheel out you can wobble the axle in the hub: at least one of the bearings has a problem, or perhaps the axle broke or the hub shell has failed. If you have a serviceable cup and cone bearing hub, one of the cones may simply have come loose. 

The way forward depends on what kind of hub you have. Without more info on the specifics of you hub we can't provide further advice.