The imam finishes a rakah with each group; the first group later completes without recitation as lahiq, while the second group later completes with recitation as masbuq.
The imam’s salam completes his prayer, not the outstanding unit each group must finish.