We propose a real-time algorithm of search and path planning after a static or a moving target in a discrete probability space. The search is conducted by an autonomous mobile agent that is given an initial probability distribution of the target's location, and at each search step obtains information regarding target's location in the agent's local neighborhood. The suggested algorithm implements a decision-making procedure of a probabilistic version of local search with estimated global distances and results in agent's path over the domain. The suggested algorithm finds efficiently both static and moving targets, as well as targets that change their movement patterns during the search. Additional information regarding the target locations, which is unknown at the beginning of the search, can be integrated in the search in real-time, as well. It is found that for the search after a static target, the algorithm actions depend on the global estimation at all stages of the search, while for the search after a moving target the global estimations mostly affect the initial search steps. Preliminary analysis shows that for the search after a static target the obtained average number of steps is close to optimal, while for the Markovian target the average number of steps is at least in the bounds that are provided by known search methods.