WASHINGTON (AP) — Retiring Rep. Joe Kennedy III used his farewell speech from Congress on Wednesday to deride the “great lie of our times” that the government lacks the resources and will to help people in need. He said the real problem is greed, not scarcity.

Speaking for five minutes on the House floor, Kennedy, D-Mass., called his four terms in Congress an honor and said he was departing “proud and hopeful.”

But the only remaining member in Congress of the vaunted Kennedy political dynasty also said the U.S. was “a complicated and messy country.” He said it had “violated our founding promises before the ink was dry,” citing slavery and rights that initially applied largely to “rich, white and Protestant men.”

Kennedy, 40, said the country was gradually making progress, saying, “Our arc isn’t clean, but it is clear.”

But without mentioning names or political parties, he called that progress “the counterweight to the great lie of our times: that the American pie is finite. That for my family to survive, yours must suffer. That the richest nation on Earth is somehow plagued by scarcity – rather than greed.”

He added, “Loosening that lie’s grip on our country is the work of our generation. For the people who feel unseen, unheard and unpresented. For those most in need of assistance and protection, justice and opportunity, who have been told by their government that there is just no room or money or time or will. And that injustice is a reality etched in stone, rather than a deliberate choice by those in power, about who is worthy and who is not.”

Kennedy’s remarks came three months after many progressives in his party opposed him in a Democratic primary in which he unsuccessfully challenged long-time liberal Sen. Ed Markey, 74. For decades, lawmakers from Kennedy’s family have been associated with some of the most progressive causes of their day.

The departing lawmaker did not say what he will do after leaving Congress.

Kennedy is the grandson of the late Sen. Robert Kennedy, D-N.Y., who was assassinated in 1968. A member of that Kennedy family has been in Congress with little interruption since Robert Kennedy’s brother, the future President John F. Kennedy, entered the House from Massachusetts in 1947.

Current Sen. John Kennedy, R-La., is not a member of that family.

Meanwhile, a spokeswoman for former Rep. Patrick Kennedy, D-R.I., said he is pursuing the post of director of the federal Office of National Drug Control Policy under President-elect Joe Biden. Patrick Kennedy, great uncle of the retiring congressman, battled drug addiction and has worked privately to bolster mental health substance abuse programs.