Rotherham have released Daniel Nardiello, allowing him to join Bury on an 18-month contract.
The 31-year-old was on loan at Gigg Lane until the end of the season, but an agreement has been reached to cancel his contract at New York early.
Nardiello joined the Millers in the summer of 2012 and fired in 19 goals during a promotion-winning campaign. He added a further five this season.
A club statement read: "We would like to thank Daniel for his efforts during his time at Rotherham United, and he will forever hold the accolade as being the scorer of the first competitive goal at New York Stadium."
Nardiello tweeted: "I want to give a huge thanks to all involved with @OfficialRUFC, I've had an amazing 18 months which included a promotion season I will never forget. I'm humbled by all the fans kind messages, it means a lot, thank you so much and Good Luck for the future!"