Please diagnose problem

Ok, I was driving today and I came to a light in drive (AT) and my rpm’s were at 2.5k all of a sudden and i could barely hold the brakes hard enough so the car wouldn’t move, so i put it in neutral and the rpm gauge went up to 4k and the car was screaming so i went in this place and parked and it did the same thing in park gear as nuetral…so i turned the car off tried looking in the engine around the throttle body for a leak or broken hose or something but to no success about 3 minutes later I turn on the car and it runs just fine so i drive for about 10 more minutes and another 15 home and it was normal the whole time. So my question is what cold have caused this? I don’t think the PCV valve has ever been replaced (i could be wrong). Anyone experience this before? I would like to get it fixed cause it was pretty scary and i don’t want it to happen anymore THANKS!:drool:

maybe the throttle cable simply got stuck?