If a unit is engaged in close combat and panics then the normal Flee and Pursuit rules apply. The fleeing unit can therefore be pursued if its enemy won the preceding combat, and consequently the fleeing unit may be destroyed in the same way as a unit that breaks following defeat in combat. If the enemy did not win the previous combat (or the two have not yet fought for some reason) the enemy cannot pursue.
Note that a unit which panics and flees from combat does not cause other units to panic as a result (ie, because friends break from close combat within 6"). A test is only required for friends that are defeated in combat and then broken as a result.