Police officers raided outbuildings in the remote hamlet of Newmill on Teviot, five miles south of Hawick, last Wednesday, and recovered a large quantity of cannabis plants, estimated to have a street value of £1m, according to Police Scotland.
Thirty-year-old Jani Rrsa and Andrea Mehilli, who is 20, appeared in private at Jedburgh Sheriff Court charged with producing a controlled drug.
They made no plea; the case was continued for further examination and they were remanded in custody.
The two men, who gave addresses in the Hawick area, will appear in court again next week.
Detective Chief Inspector Bryan Burns, of Lothians and Scottish Borders CID, said: "Based on intelligence, both specialist and community officers, carried out a pro-active operation which resulted in a significant seizure of cannabis and the arrest of two men.
"The majority of cultivations that we uncover come from information given to us from our communities and I would like to thank the local community in the Scottish Borders for their continued support.
"I hope this operation highlights our determination to tackle drug activity at all levels. In addition to tackling and dismantling the cannabis cultivations themselves, we will continue to do everything in our powers to strip those responsible of their criminal assets using the Proceeds of Crime Act, so that they do not benefit financially from their crimes."