Two Tennessee brothers who stockpiled 17,700 bottles of hand sanitizer have avoided prosecution and a fine, but won’t recoup the thousands of dollars they spent on the supplies under the terms of a price-gouging settlement that the state attorney general announced this week.

The brothers, Matt Colvin and Noah Colvin, donated the supplies last month to people in Tennessee and Kentucky, which the authorities said on Tuesday was acceptable as restitution and was a factor in the settlement terms in the highly publicized case.

The siblings, who live outside Chattanooga, were widely vilified after Matt Colvin, 36, told The New York Times last month that he and his brother, who is 21, had canvassed dollar stores and other retailers across Tennessee and Kentucky for hand sanitizer and antibacterial wipes during the early stages of the coronavirus pandemic.

Mr. Colvin said at the time that he had sold 300 bottles of hand sanitizer on Amazon for $8 to $70 each, multiple times higher than what he had paid. The next day, Amazon pulled the additional items that he had listed from its retail platform, along with those of thousands of other sellers.