The 23-year-old netted four goals in his country's Copa America campaign earlier this year and is considered a bright prospect.
City chief executive Alistair Mackintosh said: "Nery Castillo's desire to make this deal happen has been extraordinary.
"He has made a significant financial contribution in order to complete this move by paying most of the loan fee himself. This proves how much he wants to play for Manchester City in the Premier League.
"We are excited and delighted that another young established international has joined the football club."