HYUNDAI ACCENT GAS PROBLEM

2005 Hyundai Accent • 175,000 miles

I was driving today on the freeway going about 70 mph when all of the sudden the car started to decelerate. I hadn't moved my foot from the gas and I slowed to about 55 mph. When this happened I gave it more gas and the car sped back up, seemingly like the engine reengaged to the car. This happened about 5 min later and then I pulled of the road and had my car towed home. When I gave the car gas, the rpm gauge went up, however it was as if the power from the engine was not being transferred to the car. I have no idea what is wrong with it and any help/advice/knowledge would be greatly appreciated.