opinion: Mb. Justice Stewakt
  delivered the opinion of the Court.
  In 1972 Congress enacted the Supplemental Security Income program to aid the needy aged, blind, and disabled. The legislation creating the program provides that benefits are not to be paid for any month that the recipient spends entirely outside of the United States. The primary issue in the present litigation is whether this restriction is a constitutionally impermissible burden on the asserted right of international travel.
  I
  The 1972 Social Security Act Amendments repealed Titles I, X, and XIV of the Act, which had provided federal aid for state programs for the aged, blind, and disabled. The amendments replaced those programs with a new Title XVI, the Supplemental Security Income (SSI) program. 86 Stat. 1465, 42 U. S. C. § 1381 et seq. This program is administered by the Federal Government through the Social Security Administration. To be eligible to receive benefits under the program, a person must be a resident of the United States, 42 U. S. C. § 1382c (a)(1) (B); be either over 65 years old or meet statutory definitions of blindness and disability, § 1382c (a); and be poor, §§ 1382a (income), 1382b (resources).
  Section 1611 (f) of the Social Security Act, as added in 1972, provides that no person shall receive SSI benefits “for any month during all of which such individual is outside the United States . . . .” The section further provides that
  “after an individual has been outside the United States for any period of 30 consecutive days, he shall be treated as remaining outside the United States until he has been in the United States for a period of 30 consecutive days.”
  Thus, if a recipient were to leave the country on May 5 and return on July 10, he would receive his entire payment for May. He would, however, lose his benefits for June and July. He would have been actually away the entire month of June, and, because he had been gone for more than 30 days, he would be treated as having remained outside the country until August 9. In August his payments would automatically resume.
  Grace Aznavorian is an American citizen. In 1974 she was a resident of California and an eligible recipient of SSI benefits. On July 21, 1974, she left the United States and traveled to Guadalajara, Mexico. Because of an unexpected illness, she remained in Mexico until September 1, 1974. Accordingly, she did not receive benefits for August or September.
  Aznavorian pursued her administrative remedies without success. She then filed this suit in the United States District Court for the Southern District of California, seeking judicial review of the Secretary’s decision. Asserting that the suspension of her benefits denied her due process, equal protection, and the right of international travel, all as guaranteed by the Fifth Amendment, she sought declaratory relief and the benefits which had been denied because of her visit to Mexico. She moved for certification of a plaintiff class including all persons denied SSI benefits because of international travel. The Secretary moved for summary judgment.
  The District Court first considered the motion for class certification. It concluded that a class action was not barred by the Social Security Act because the class would be limited to those who had presented unsuccessful claims to the Secretary. Because the requirements of Fed. Rule Civ. Proc. 23 were otherwise satisfied, it certified the class. 440 F. Supp. 788, 792-794.
  The court then granted summary judgment to the plaintiff class. Because international travel is “a basic constitutional right,” the District Court held that the statute must bear “a fair and substantial relationship in fact to the governmental purposes that it seeks to achieve.” Id., at 795, 797. The court concluded that the limitation on benefits was not sufficiently related to the Government’s interest in making payments only to bona fide residents of the United States to be constitutionally valid.
  The District Court ordered the Secretary to provide notice of its decision to all class members who were receiving benefits at the time of the order or would have been receiving benefits except for § 1611 (f). It also ordered the Secretary to pay benefits to those members of the class whose benefits had been suspended because of § 1611 (f), but who in fact continued to be actual residents of the United States. Because its order was limited to persons who were still needy within the meaning of the SSI program, the court believed that its order did not violate the sovereign immunity of the United States. 440 P. Supp., at 802-803.
  The Secretary appealed directly to this Court, and Azna-vorian filed a cross-appeal under 28 U. S. C. § 1252. We noted probable jurisdiction of both appeals and consolidated the cases. 435 U. S. 921.
  II
  The Secretary raises two questions on his appeal. First, he contends that § 1611 (f) does not violate the Fifth Amendment. Second, he urges that in any event the District Court’s award of retroactive monetary relief is barred by sovereign immunity. Aznavorian’s cross-appeal takes the position that the District Court erred in awarding monetary relief only to those class members who were eligible for SSI benefits on the date of its order. Because we conclude that § 1611 (f) does not violate the Constitution, there is no occasion to consider the remedial issues raised by the appeal and cross-appeal.
  Social welfare legislation, by its very nature, involves drawing lines among categories of people, lines that necessarily are sometimes arbitrary. This Court has consistently upheld the constitutionality of such classifications in federal welfare legislation where a rational basis existed for Congress’ choice.
  “The basic principle that must govern an assessment of any constitutional challenge to a law providing for governmental payments of monetary benefits is well established. ... In enacting legislation of this kind a government does not deny equal protection 'merely because the classifications made by its laws are imperfect. If the classification has some “reasonable basis,” it does not offend the Constitution simply because the classification “is not made with mathematical nicety or because in practice it results in some inequality.” ’ Dandridge v. Williams, 397 U. S. 471, 485.
  “To be sure, the standard by which legislation such as this must be judged 'is not a toothless one,’ Mathews v. Lucas, 427 U. S. 495, 510. But the challenged statute is entitled to a strong presumption of constitutionality.” Mathews v. De Castro, 429 U. S. 181, 185.
  See, e. g., Califano v. Jobst, 434 U. S. 47; Califano v. Goldfarb, 430 U. S. 199, 210; Mathews v. Diaz, 426 U. S. 67; Weinberger v. Salfi, 422 U. S. 749; Jefferson v. Hackney, 406 U. S. 535; Richardson v. Belcher, 404 U. S. 78.
  Aznavorian argues that, even though § 1611 (f) may under this standard be valid as against an equal protection or due process attack, a more stringent standard must be applied in a constitutional appraisal of § 1611 (f) because this statutory provision limits the freedom of international travel. We have concluded, however, that § 1611 (f), fortified by its presumption of constitutionality, readily withstands attack from that quarter as well.
  The freedom to travel abroad has found recognition in at least three decisions of this Court. In Kent v. Dulles, 357 U. S. 116, the Secretary of State had refused to issue a passport to a person because of his links with leftwing political groups. The Court held that Congress had not given the Secretary discretion to deny passports on such grounds. Although the holding was one of statutory construction, the Court recognized that freedom of international travel is “basic in our scheme of values” and an “important aspect of the citizen’s ‘liberty.’ ” Id., at 126, 127. Aptheker v. Secretary of State, 378 U. S. 500, dealt with § 6 of the Subversive Activities Control Act, 50 U. S. C. § 785, which made it a criminal offense for a member of the Communist Party to apply for a passport. The Court again recognized that the freedom of international travel is protected by the Fifth Amendment. Congress had legislated too broadly by restricting this liberty for all members of the party. In Zemel v. Rusk, 381 U. S. 1, the Court upheld the Secretary’s decision not to validate passports for travel to Cuba. The Court pointed out that “the fact that a liberty cannot be inhibited without due process of law does not mean that it can under no circumstances be inhibited.” Id., at 14.
  Aznavorian urges that the freedom of international travel is basically equivalent to the constitutional right to interstate travel, recognized by this Court for over 100 years. Edwards v. California, 314 U. S. 160; Twining v. New Jersey, 211 U. S. 78, 97; Williams v. Fears, 179 U. S. 270, 274; Crandall v. Nevada, 6 Wall. 35, 43-44; Passenger Cases, 7 How. 283, 492 (Taney, C. J., dissenting). But this Court has often pointed out the crucial difference between the freedom to travel internationally and the right of interstate travel.
  “The constitutional right of interstate travel is virtually unqualified, United States v. Guest, 383 U. S. 745, 757-758 (1966); Griffin v. Breckenridge, 403 U. S. 88, 105-106 (1971). By contrast the ‘right’ of international travel has been considered to be no more than an aspect of the ‘liberty’ protected by the Due Process Clause of the Fifth Amendment. As such this ‘right,’ the Court has held, can be regulated within the bounds of due process.” (Citations omitted.) Califano v. Torres, 435 U. S. 1, 4 n. 6.
  See Shapiro v. Thompson, 394 U. S. 618, 643 n. 1 (concurring opinion). Thus, legislation which is said to infringe the freedom to travel abroad is not .to be judged by the same standard applied to laws that penalize the right of interstate travel, such as durational residency requirements imposed by the States. See Memorial Hospital v. Maricopa County, 415 U. S. 250, 254-262; Dunn v. Blumstein, 405 U. S. 330, 338-342; Shapiro v. Thompson, supra, at 634.
  Unlike cases involving the right of interstate travel, this case involves legislation providing governmental payments of monetary benefits that has an incidental effect on a protected liberty, similar to the legislation considered in Califano v. Jobst, supra. There, another section of the Social Security Act was challenged because it “penalized” some beneficiaries upon their marriage. The Court recognized that the statutory provisions “may have an impact on a secondary beneficiary’s desire to marry, and may make some suitors less welcome than others,” 434 U. S., at 58, but nonetheless upheld the constitutional validity of the challenged legislation.
  The statutory provision in issue here does not have nearly so direct an impact on the freedom to travel internationally as occurred in the Kent, Aptheker, or Zemel cases. It does not limit the availability or validity of passports. It does not limit the right to travel on grounds that may be in tension with the First Amendment. It merely withdraws a governmental benefit during and shortly after an extended absence from this country. Unless the limitation imposed by Congress is wholly irrational, it is constitutional in spite of its incidental effect on international travel.
  It is to be noted that Aznavorian does not question the constitutional validity of the basic decision of Congress to limit SSI payments to residents of the United States, as provided in § 1614 (a) (1) (B) of the Social Security Act, as amended, 42 U. S. C. § 1382c (a)(1)(B). The statutory provision in issue, § 1611 (f), clearly effectuates this basic congressional decision. Certainly, the longer a person is out of the country, the greater the possibility that he is no longer a resident. The 30-day period provided in § 1611 (f) is no more arbitrary than any similar time period would be. The additional provision of § 1611 (f) that, once a person has been outside the country for 30 consecutive days or more, he will not be eligible for SSI payments until he has spent 30 consecutive days in the United States, simply adds assurance that the beneficiary’s residency here is genuine.
  Moreover, as the Secretary argues, Congress may simply have decided to limit payments to those who need them in the United States. The needs to which this program responds might vary dramatically in foreign countries. The Social Security Administration would be hard pressed to monitor the continuing eligibility of persons outside the country. And, indeed, Congress may only have wanted to increase the likelihood that these funds would be spent inside the United States.
  These justifications for the legislation in question are not, perhaps, compelling. But its constitutionality does not depend on compelling justifications. It is enough if the provision is rationally based. Dandridge v. Williams, 397 U. S. 471, 487. Section 1611 (f) meets that test. Accordingly, the judgment of the District Court is reversed.
  It is so ordered.
  The section reads in full:
  “Notwithstanding any other provision of this title, no individual shall be considered an eligible individual for purposes of this title for any month during all of which such individual is outside the United States (and no person shall be considered the eligible spouse of an individual for purposes of this title with respect to any month during all of which such person is outside the United States). For purposes of the preceding sentence, after an individual has been outside the United States for any period of 30 consecutive days, he shall be treated as remaining outside the United States until he has been in the United States for a period of 30 consecutive days.” 86 Stat. 1468, 42 U. S. C. § 1382 (f).
  Jurisdiction was based on two provisions of the Social Security Act: §§205 (g) and 1631 (c)(3), 42 U. S. C. §§405 (g) and 1383 (c)(3).
  Her original complaint requested injunctive relief and moved that a three-judge court be convened. The motion for a three-judge court was later withdrawn along with the request for an injunction.
  The certified class' was defined as:
  “All individuals otherwise eligible for Supplemental Security Income, who have had such SSI denied, suspended, terminated, or interrupted pursuant to an initial written determination, an administration reconsideration, an administrative hearing, or an Appeals Council review, based solely on 42 U. S. C. § 1382 (f) and regulations promulgated thereunder, from September 26, 1975 until the entry of this Order.”
  The Secretary’s jurisdictional statement also claimed that a class action could not be maintained under § 205 (g) of the Social Security Act: That question was raised but not decided in Norton v. Mathews, 427 U. S. 524. While not abandoning his position, the Secretary has chosen not to argue the question in this case. The question is pending in Califano v. Elliott, No. 77-1511, cert. granted, post, p. 816. It is conceded that Aznavorian, as an individual, met the jurisdictional requirements of § 205 (g).
  In contrast to the monetary-benefits legislation upheld in the Jobst case, a state law that burdened the freedom to marry was held constitutionally invalid later the same Term in Zablocki v. Redhail, 434 U. S. 374.
choices: attorney general of the United States, or his office specified state board or department of education city, town, township, village, or borough government or governmental unit state commission, board, committee, or authority county government or county governmental unit, except school district court or judicial district state department or agency governmental employee or job applicant female governmental employee or job applicant minority governmental employee or job applicant minority female governmental employee or job applicant not listed among agencies in the first Administrative Action variable retired or former governmental employee U.S. House of Representatives interstate compact judge state legislature, house, or committee local governmental unit other than a county, city, town, township, village, or borough governmental official, or an official of an agency established under an interstate compact state or U.S. supreme court local school district or board of education U.S. Senate U.S. senator foreign nation or instrumentality state or local governmental taxpayer, or executor of the estate of state college or university United States State person accused, indicted, or suspected of crime advertising business or agency agent, fiduciary, trustee, or executor airplane manufacturer, or manufacturer of parts of airplanes airline distributor, importer, or exporter of alcoholic beverages alien, person subject to a denaturalization proceeding, or one whose citizenship is revoked American Medical Association National Railroad Passenger Corp. amusement establishment, or recreational facility arrested person, or pretrial detainee attorney, or person acting as such;includes bar applicant or law student, or law firm or bar association author, copyright holder bank, savings and loan, credit union, investment company bankrupt person or business, or business in reorganization establishment serving liquor by the glass, or package liquor store water transportation, stevedore bookstore, newsstand, printer, bindery, purveyor or distributor of books or magazines brewery, distillery broker, stock exchange, investment or securities firm construction industry bus or motorized passenger transportation vehicle business, corporation buyer, purchaser cable TV car dealer person convicted of crime tangible property, other than real estate, including contraband chemical company child, children, including adopted or illegitimate religious organization, institution, or person private club or facility coal company or coal mine operator computer business or manufacturer, hardware or software consumer, consumer organization creditor, including institution appearing as such; e.g., a finance company person allegedly criminally insane or mentally incompetent to stand trial defendant debtor real estate developer disabled person or disability benefit claimant distributor person subject to selective service, including conscientious objector drug manufacturer druggist, pharmacist, pharmacy employee, or job applicant, including beneficiaries of employer-employee trust agreement, employee health and welfare fund, or multi-employer pension plan electric equipment manufacturer electric or hydroelectric power utility, power cooperative, or gas and electric company eleemosynary institution or person environmental organization employer. If employer's relations with employees are governed by the nature of the employer's business (e.g., railroad, boat), rather than labor law generally, the more specific designation is used in place of Employer. farmer, farm worker, or farm organization father female employee or job applicant female movie, play, pictorial representation, theatrical production, actor, or exhibitor or distributor of fisherman or fishing company food, meat packing, or processing company, stockyard foreign (non-American) nongovernmental entity franchiser franchisee lesbian, gay, bisexual, transexual person or organization person who guarantees another's obligations handicapped individual, or organization of devoted to health organization or person, nursing home, medical clinic or laboratory, chiropractor heir, or beneficiary, or person so claiming to be hospital, medical center husband, or ex-husband involuntarily committed mental patient Indian, including Indian tribe or nation insurance company, or surety inventor, patent assigner, trademark owner or holder investor injured person or legal entity, nonphysically and non-employment related juvenile government contractor holder of a license or permit, or applicant therefor magazine male medical or Medicaid claimant medical supply or manufacturing co. racial or ethnic minority employee or job applicant minority female employee or job applicant manufacturer management, executive officer, or director, of business entity military personnel, or dependent of, including reservist mining company or miner, excluding coal, oil, or pipeline company mother auto manufacturer newspaper, newsletter, journal of opinion, news service radio and television network, except cable tv nonprofit organization or business nonresident nuclear power plant or facility owner, landlord, or claimant to ownership, fee interest, or possession of land as well as chattels shareholders to whom a tender offer is made tender offer oil company, or natural gas producer elderly person, or organization dedicated to the elderly out of state noncriminal defendant political action committee parent or parents parking lot or service patient of a health professional telephone, telecommunications, or telegraph company physician, MD or DO, dentist, or medical society public interest organization physically injured person, including wrongful death, who is not an employee pipe line company package, luggage, container political candidate, activist, committee, party, party member, organization, or elected official indigent, needy, welfare recipient indigent defendant private person prisoner, inmate of penal institution professional organization, business, or person probationer, or parolee protester, demonstrator, picketer or pamphleteer (non-employment related), or non-indigent loiterer public utility publisher, publishing company radio station racial or ethnic minority person or organization protesting racial or ethnic segregation or discrimination racial or ethnic minority student or applicant for admission to an educational institution realtor journalist, columnist, member of the news media resident restaurant, food vendor retarded person, or mental incompetent retired or former employee railroad private school, college, or university seller or vendor shipper, including importer and exporter shopping center, mall spouse, or former spouse stockholder, shareholder, or bondholder retail business or outlet student, or applicant for admission to an educational institution taxpayer or executor of taxpayer's estate, federal only tenant or lessee theater, studio forest products, lumber, or logging company person traveling or wishing to travel abroad, or overseas travel agent trucking company, or motor carrier television station union member unemployed person or unemployment compensation applicant or claimant union, labor organization, or official of veteran voter, prospective voter, elector, or a nonelective official seeking reapportionment or redistricting of legislative districts (POL) wholesale trade wife, or ex-wife witness, or person under subpoena network slave slave-owner bank of the united states timber company u.s. job applicants or employees Army and Air Force Exchange Service Atomic Energy Commission Secretary or administrative unit or personnel of the U.S. Air Force Department or Secretary of Agriculture Alien Property Custodian Secretary or administrative unit or personnel of the U.S. Army Board of Immigration Appeals Bureau of Indian Affairs Bonneville Power Administration Benefits Review Board Civil Aeronautics Board Bureau of the Census Central Intelligence Agency Commodity Futures Trading Commission Department or Secretary of Commerce Comptroller of Currency Consumer Product Safety Commission Civil Rights Commission Civil Service Commission, U.S. Customs Service or Commissioner of Customs Defense Base Closure and REalignment Commission Drug Enforcement Agency Department or Secretary of Defense (and Department or Secretary of War) Department or Secretary of Energy Department or Secretary of the Interior Department of Justice or Attorney General Department or Secretary of State Department or Secretary of Transportation Department or Secretary of Education U.S. Employees' Compensation Commission, or Commissioner Equal Employment Opportunity Commission Environmental Protection Agency or Administrator Federal Aviation Agency or Administration Federal Bureau of Investigation or Director Federal Bureau of Prisons Farm Credit Administration Federal Communications Commission (including a predecessor, Federal Radio Commission) Federal Credit Union Administration Food and Drug Administration Federal Deposit Insurance Corporation Federal Energy Administration Federal Election Commission Federal Energy Regulatory Commission Federal Housing Administration Federal Home Loan Bank Board Federal Labor Relations Authority Federal Maritime Board Federal Maritime Commission Farmers Home Administration Federal Parole Board Federal Power Commission Federal Railroad Administration Federal Reserve Board of Governors Federal Reserve System Federal Savings and Loan Insurance Corporation Federal Trade Commission Federal Works Administration, or Administrator General Accounting Office Comptroller General General Services Administration Department or Secretary of Health, Education and Welfare Department or Secretary of Health and Human Services Department or Secretary of Housing and Urban Development Interstate Commerce Commission Indian Claims Commission Immigration and Naturalization Service, or Director of, or District Director of, or Immigration and Naturalization Enforcement Internal Revenue Service, Collector, Commissioner, or District Director of Information Security Oversight Office Department or Secretary of Labor Loyalty Review Board Legal Services Corporation Merit Systems Protection Board Multistate Tax Commission National Aeronautics and Space Administration Secretary or administrative unit of the U.S. Navy National Credit Union Administration National Endowment for the Arts National Enforcement Commission National Highway Traffic Safety Administration National Labor Relations Board, or regional office or officer National Mediation Board National Railroad Adjustment Board Nuclear Regulatory Commission National Security Agency Office of Economic Opportunity Office of Management and Budget Office of Price Administration, or Price Administrator Office of Personnel Management Occupational Safety and Health Administration Occupational Safety and Health Review Commission Office of Workers' Compensation Programs Patent Office, or Commissioner of, or Board of Appeals of Pay Board (established under the Economic Stabilization Act of 1970) Pension Benefit Guaranty Corporation U.S. Public Health Service Postal Rate Commission Provider Reimbursement Review Board Renegotiation Board Railroad Adjustment Board Railroad Retirement Board Subversive Activities Control Board Small Business Administration Securities and Exchange Commission Social Security Administration or Commissioner Selective Service System Department or Secretary of the Treasury Tennessee Valley Authority United States Forest Service United States Parole Commission Postal Service and Post Office, or Postmaster General, or Postmaster United States Sentencing Commission Veterans' Administration War Production Board Wage Stabilization Board General Land Office of Commissioners Transportation Security Administration Surface Transportation Board U.S. Shipping Board Emergency Fleet Corp. Reconstruction Finance Corp. Department or Secretary of Homeland Security Unidentifiable International Entity