Spacecraft starting from the surface of Earth has a zero initial speed. But, if it has enough fuel, it may be permanently accelerated by its engine until it reaches escape velocity. Then it will travel into space even after the engine is shut off.