The integration of solar energy in the electricity market faces some challenges related to the time-varying nature of energy coming from the sun. The use of energy storage emerges as a technological solution to these problems and opens new possibilities for the integration of photovoltaic (PV) plants in the electrical market. This paper addresses the problem of integration of PV plants in the electricity market, providing a solution for an optimal scheduling, which allows the plant to participate in the daily and intraday markets. In order to perform a proper scheduling, a good estimation of energy prices is of paramount importance. The paper proposes also a price forecast algorithm that provides prices in a one-day horizon, based on price historical data and meteorological information. The development of the scheduling strategy is carried out using Model Predictive Control (MPC) and taking into account operational constraints. The MPC techniques allow maximizing the economic benefit of the PV plant manipulating the energy stored and extracted from the batteries. Some results of the application of the price forecasting approach and the scheduling strategy to a simulated PV plant located in Seville (Spain) are presented. The weather data and electricity prices are publicly available, supplied by the Spanish System Operator. (C) 2016 Elsevier Ltd. All rights reserved.