This paper presents a multiagent cooperative search algorithm for identifying an unknown number of targets. The objective is to determine a collection of observation points and corresponding safe paths for agents, which involves balancing the detection time and the number of targets searched. A Bayesian framework is used to update the local probability density function of the targets when the agents obtain information. We utilize model predictive control and establish utility functions based on the detection probability and decrease in information entropy. A target detection algorithm is implemented to verify the target based on minimum‐risk Bayesian decision‐making. Then, we improve the search algorithm with the target detection algorithm. Several simulations demonstrate that compared with other existing approaches, the proposed approach can reduce the time needed to detect targets and the number of targets searched. We establish an experimental platform with three unmanned aerial vehicles. The simulation and experimental results verify the satisfactory performance of our algorithm.