Story highlights President Trump had tweeted that the FBI's reputation was "in tatters"

Wray said: "There is no finer institution than the FBI and no finer people than the men and women who work there and are its very beating heart."

Washington (CNN) FBI Director Christopher Wray defended his agency Thursday in his first public appearance since President Donald Trump said the bureau is "in tatters."

Wray told the House Judiciary Committee his agents work hard "protecting the American people and upholding the rule of law in all 50 states and in about 80 countries around the world."

"Let me start by saying that it is for me the honor of a lifetime to be here representing the men and women of the FBI," he said. "There is no finer institution than the FBI and no finer people than the men and women who work there and are its very beating heart."

When asked about Trump's tweets over the weekend criticizing the FBI, Wray told Rep. Jerry Nadler, "there is no shortage of opinions out there."

"What I can tell you is that the FBI that I see is tens of thousands of agents and analysts and staff working their tails off to keep Americans safe from the next terrorist attack, gang violence, child predators, spies from Russia, China and North Korea, and Iran," he responded. "The FBI that I see is tens of thousands of brave men and women who are working as hard as they can to keep people that they will never know safe from harm."

Read More