Japanese midfielder Keisuke Honda said on Twitter on Sunday he will be departing AC Milan at the end of the season, bringing to an end a difficult stint at the Italian giants characterized by frustratingly limited playing time.

But the 30-year-old Japan international refused to go quietly, scoring his first -- and probably last -- goal of the Serie A season as AC Milan beat Bologna 3-0 at the San Siro on Sunday. His last game in Milan's famous black and red strip will come against Cagliari on May 28.

"My dearest Milan supporters, thank you. It has been a challenging three and a half years but because of that I have been able to grow as a person," he wrote in Italian shortly after the team secured its place in next season's Europa League with a sixth-place Serie A finish.

"I will be leaving Milan after this season, but I look forward to seeing you again soon. I may not be a player then, who knows in what way we'll meet. I will continue to work hard every day to achieve my goals. Forza Milan!"

On Sunday, Honda replaced Carlos Bacca 12 minutes after the break and scored a free kick with a left-footed shot to the bottom right corner 16 minutes later to make it 2-0. The goal was his first since Feb. 14, 2016, against Genoa.

It was the seventh appearance this season for Honda, who has struggled to earn playing time since joining AC Milan in January 2014 on a free transfer and signing a three-and-a-half-year contract.

Soccer: Honda scores season's 1st goal in AC Milan's 3-0 win 

In Barcelona, Takashi Inui became the first Japanese player in La Liga history to score against Barcelona and his brace gave Eibar a 2-0 lead, but Barcelona responded with four goals, including two from Lionel Messi, in the final 27 minutes to win 4-2.

"I'm really happy that I was able to score two goals at the end of the season in this way, and I'll never forget this day. It will surely leave a lasting memory," said Inui.

"(Because it was an away game) I didn't hear any cheering so it didn't feel real," he said of his two goals at the Camp Nou.

After stunning Barcelona with a seventh-minute opener, the 28-year-old midfielder doubled the advantage just after the hour mark, but the Spanish glamor club hit back immediately with David Junca conceding an own goal when Neymar's shot hit him after rebounding off the post.

Luis Suarez leveled the score in the 73rd, and Messi put Barcelona ahead and then sealed the game on with a second in added time. Despite Messi's heroics, Barcelona could not pass Real Madrid in the La Liga standings on the final match day and missed out on a third consecutive league title.

With his sixth league goal, Inui went one better than former Mallorca player Yoshito Okubo to become the top-scoring Japanese player in the Spanish first division.

"I'm sure more Japanese players will be coming in the future and records are meant to be broken, so I'll try and improve it as much as I can," he said.