NEWARK — A lawyer representing Dr. Salomon Melgen, who is on trial on federal corruption charges here alongside Senator Robert Menendez, threatened officials from the Department of Commerce if they failed to help him resolve a contract dispute in the Dominican Republic, a federal official testified on Monday.

The official, Scott Smith, a trade specialist with the Commerce Department for 19 years, recalled an “aggressive and threatening” hourlong meeting in 2012 with Elio Muller, a lawyer who was then representing Dr. Melgen and ICSSI, a cargo-screening company in the Dominican Republic in which Dr. Melgen owned a 50 percent stake.

“He stated that Dr. Melgen had politically influential friends and that they could cause a lot of problems for the Department of Commerce if Dr. Melgen didn’t feel like he was being served correctly,” Mr. Smith testified. He added that Mr. Muller “constantly brought up the fact that they could make trouble for the department and that he could be a bull in the Commerce Department’s china shop.”

He paused, before continuing, “His tone was just threatening.”

The testimony came as the corruption trial for Dr. Melgen and Mr. Menendez, a Democrat from New Jersey, shifted from examinations of visa applications and airplane flights to charges that Mr. Menendez lobbied government officials on behalf of Mr. Melgen and the cargo-screening company. Mr. Menendez and Dr. Melgen have denied any wrongdoing.