Space combat ends when only one player—or neither player—has a ship in the space area of the active system. a. During the last round of a combat, “end of combat” and “end of combat round” effects occur during the same timing window.
This is the official Living Rules Reference wording under Space Combat.
LRR v2.0 (base game / Prophecy of Kings); specific card abilities may override the general rule.