
439 U.S. 170 (1978)
CALIFANO, SECRETARY OF HEALTH, EDUCATION, AND WELFARE
v.
AZNAVORIAN.
No. 77-991.
Supreme Court of United States.
Argued November 6, 1978.
Decided December 11, 1978.[*]
APPEAL FROM THE UNITED STATES DISTRICT COURT FOR THE SOUTHERN DISTRICT OF CALIFORNIA.
Peter Buscemi argued the cause pro hac vice for petitioner in No. 77-991 and respondent in No. 77-5999. With him on the briefs were Solicitor General McCree, Assistant Attorney General Babcock, Deputy Solicitor General Easterbrook, and William Kanter.
*171 Peter Anthony Schey argued the cause for respondent in No. 77-991 and petitioner in No. 77-5999. With him on the brief were Victor Benjamin Harris, Ralph Santiago Abascal, Charles Wolfinger, Phillip M. Gassel, and Richard Paez.
MR. JUSTICE STEWART 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 provided 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 *172 been in the United States for a period of 30 consecutive days."[1]
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.[2] 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 *173 which had been denied because of her visit to Mexico.[3] 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.[4] 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 *174 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 F. Supp., at 802-803.
The Secretary appealed directly to this Court, and Aznavorian 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.[5] 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 *175 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 *176 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 *177 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.[6]
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 *178 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.
MR. JUSTICE MARSHALL and MR. JUSTICE BRENNAN, concurring in the result.
We concur in the Court's conclusion that § 1611 (f) of the Social Security Act is constitutional. We do not, however, understand the Court to imply that welfare legislation not involving a fundamental interest or suspect classification is subject to a lesser standard of review than the traditional rational basis test. To sustain classifications in welfare legislation *179 that are "arbitrary," ante, at 174, so long as they are not "wholly irrational," ante, at 177, would be inconsistent with the settled principle that the "standard by which [welfare] legislation. . . must be judged `is not a toothless one.'" Mathews v. De Castro, 429 U. S. 181, 185 (1976), quoting Mathews v. Lucas, 427 U. S. 495, 510 (1976).
NOTES
[*]  Together with No. 77-5999, Aznavorian v. Califano, Secretary of Health, Education, and Welfare, also on appeal from the same court.
[1]  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).
[2]  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).
[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.
[4]  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."
[5]  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).
[6]  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.
