JAKARTA, Indonesia—Foreign direct investment in Indonesia rose to $29.27 billion in 2015 from $28.53 billion a year earlier, the official Investment Coordinating Board said Thursday.

The gain in FDI indicates improving investor sentiment in the country since the 2014 election of President Joko Widodo, who has been trying to attract foreign investors, especially from China.

For the fourth quarter, FDI increased to $7.94 billion from $6.78 billion a year earlier and $7.40 billion in the third quarter, the board said.

The data reflects only those investments that were realized, not just pledged, said the agency, which issues licenses and promotes investment opportunities in Indonesia.

Domestic investors invested $179.5 trillion in 2015, up 15% from a year earlier.