(Adds details and background)

RABAT, Jan 6 (Reuters) - Morocco's economy grew 4.7 percent year-on-year in the fourth quarter of 2015, up from 2.2 percent in the similar 2014 period thanks to higher agricultural output, the national planning agency said on Wednesday.

Morocco announced a record cereal crop of 11 million tonnes last year after favourable rainfall. Agriculture accounts for more than 15 percent of the economy.

However, late rains are threatening this year's harvest though the government is still expecting a medium cereal harvest of seven million tonnes.

Morocco's high planning authority, known as HCP, said this year's harvest would fall 15 percent from a medium year, or to around 6 millions tonnes of cereal crop. Growth is expected to fall to 2 percent in the first quarter of this year, it said.

The non-agricultural sector would grow 2.2 pct in the first quarter from a year ago, the agency said.

The trade deficit fell 19.7 percent to 140.02 billion dirhams ($14.22 billion) in the first 11 months of 2015 compared with a year earlier, thanks to lower energy costs and higher exports.

The central bank said growth would slow to 2.1 percent for the whole of 2016, with the government expecting 3 percent. The planning agency forecasts 2.6 percent.

(Reporting By Aziz El Yaakoubi; editing by Richard Balmforth) ((aziz.elyaakoubi@thomsonreuters.com; +212623934595)(;))