This paper proposes a novel hybrid algorithm namely APSO-BFO which combines merits of Bacterial Foraging Optimization (BFO) algorithm and Adaptive Particle Swarm Optimization (APSO) algorithm to determine the optimal PID parameters for control of nonlinear systems. To balance between exploration and exploitation, the proposed hybrid algorithm accomplishes global search over the whole search space through the APSO algorithm whereas the local search is performed by BFO algorithm. The proposed algorithm starts with APSO algorithm. In the proposed APSO, every particle dynamically adjusts inertia weight according to feedback taken from particles best memories. In this case, APSO algorithm is used to enhance global search ability and to increase convergence speed. When the change in fitness value is smaller than a predefined value, the searching process is switched to BFO to accelerate the search process and find an accurate solution. In this way, this hybrid algorithm may find an optimum solution more accurately. To demonstrate the effectiveness of the proposed algorithm, its results are compared with those obtained by Basic PSO (BPSO), Standard BFO (SBFO), BFO with PSO (PSO-BFO), BFO with GA (GA-BFO) and Differential Evolution with BFO (DE-BFO). The numerical simulations are shown the potential of proposed algorithm.