So he left them with the king of Moab, and they stayed with him as long as David was hiding in the stronghold.