An artificial neural network (ANN) based on particle swarm optimization (PSO) was developed for the time series prediction. This hybrid ANN+PSO algorithm was applied on Mackey-Glass series in the short-term prediction x(t+6) and the long-term prediction x(t+84), from the current value x(t) and the past values: x(t-6), x(t-12), x(t-18). Four cases were studied, alternating the timedelay parameter as 17 or 30. Also, the first four largest Lyapunov exponents were obtained for different time-delay. Simulation shows that this ANN+PSO method is a very powerful tool for making prediction of chaotic time series.