This could be a few things, one is not immediately concerning and the other should be evaluated shortly.
The least concerning possibility would be a popliteal cyst - a fluid-containing outpouching of the joint lubricating capsule can herniate out between muscular/tendinous structures in the back of the knee (also known as a bakers cyst)
This may have just formed in your knee or if you had one already it may have ruptured which can cause irritation but has no immediate concerning problem. These can be aspirated as an outpatient if needed (a needle on a syringe is used to withdrawal the fluid).
Another possibility is rupture of a small vessel in the back of the calf. There is a specific vessel that not all people have. This artery can actually be torn and cause hemorrhage into the calf muscles and behind the knee. If there is enough blood lost into this space it can cause compression of the nerves and in rare cases can require evacuation (opening up on the space into which bleeding is occuring).
Aside from that, tearing of that vessel is of no consequence in the long-term to the blood supply to the lower leg and the foot because there are enough other arteries and this artery I am referring to is so tiny that some people don't even have it.
For that reason, if you are noticing swelling you need to go to the ER for an ultrasound.
Another less likely possibility for this type of an acute presentation would be a clot in the legs, however it is a minor possibility and also requires emergent ultrasound evaluation as clots in the legs can travel to the lungs and potentially be fatal, however as I said the immediate presentation you experienced is not stereotypical of the pain and swelling that arises over a bit longer of a period of time than what you've described
You could also have a "loose body" (piece of bony or cartilage debris that floats around in your knee) from a meniscal tear or degenerative disease that unfortunately floated to an uncomfortable place within the joint and therefore is causing pain. This is not of acute concern and can be evaluated with an xray and if needed MRI.
Because two of these possibilities are of immediate concern, my overall recommendation to you would be to go to the ER based upon what you've told me of your symptoms as a severe pain that is bad enough that you can't walk.
Does that make good sense to you? Both of my explanation of possible causes and why two of those are concerning enough to warrant a visit to the ER?