A new method for real-time obstacle avoidance and trajectory planning of underactuated unmanned surface vessels is presented. In this method, ordinary differential equations (ODEs) are used to define transitional trajectories that can avoid obstacles and reach a final desired target trajectory using a robust tracking control law. The obstacles are approximated and enclosed by elliptical shapes. A transitional trajectory is then defined by a set of ordinary differential equations whose solution is a stable elliptical limit cycle defining the nearest obstacle on the vessel's path to the target. When no obstacle blocks the vessel's path to its target, the transitional trajectory is defined by exponentially stable ODE whose solution is the target trajectory. The planned trajectories are tracked by the vessel through a sliding mode control law that is robust to environmental disturbances and modeling uncertainties and can be computed in real time. The method is illustrated using a complex simulation example with a moving target and multiple moving and rotating obstacles and a simpler experimental example with stationary obstacles.