THAM LUANG CAVE, Thailand — The prime minister of Thailand, Prayuth Chan-ocha, offered words of encouragement on Friday to the families of 12 boys and their soccer coach trapped in a flooded cave complex, and pledged to continue a massive search and rescue operation.

“Until they come out, the officers will never abandon them,” Mr. Prayuth told about 75 relatives during his visit, in which he also inspected the cave entrance and spoke with officials leading the closely watched search.

Later, however, officials acknowledged that they faced many obstacles in finding the boys, aged 11 to 16, and their coach, 25, who have been missing since Saturday afternoon.

Despite a major mobilization of soldiers, park rangers, expert divers, engineers and geologists, the operation has made little headway.