Mr. Justice Stewart
delivered the opinion of the Court.
The petitioners, citizens of Mexico, entered the United States illegally. To assure their presence as material witnesses at the federal criminal trials of those accused of illegally bringing them into this country, they were required to post bond pursuant to former Rule 46 (b) of the Federal Rules of Criminal Procedure. Unable to make bail, they were incarcerated.
The petitioners instituted the present class action in the United States District Court for the Western District of Texas on behalf of themselves and others similarly incarcerated as material witnesses. Their complaint alleged that they, and the other members of their class, had been paid only $1 for every day of their confinement; that the statute providing the compensation to be paid witnesses requires payment of a total of $21 per day to material witnesses in custody; and that, alternatively, if the statute be construed to require payment of only $1 per day to detained witnesses, it violates the Fifth Amendment guarantees of just compensation and due process. They did not attack the validity or length of their incarceration as such, but sought monetary damages under the Tucker Act, 28 U. S. C. § 1346 (a)(2), for the lost compensation claimed, and equivalent declaratory and injunctive relief.
The statute in question, 28 U. S. C. § 1821, provides that a “witness attending in any court of the United States . . . shall receive $20 for each day’s attendance and for the time necessarily occupied in going to and returning from the same A separate paragraph of the statute entitles “a witness . . . detained in prison for want of security for his appearance, ... in addition to his subsistence, to a compensation of $1 per day.”
The petitioners’ complaint was grounded upon the theory that they were “attending in . . . court” throughout the period of their incarceration, since they were prevented from engaging in their normal occupations in order to be ready to testify. They argued that the $20 fee is compensation for the inconvenience and private loss suffered when a witness comes to testify, and that all of these burdens are borne by the incarcerated witness throughout his confinement. Urging that the compensation provisions should be applied as broadly as the problem they were designed to ameliorate, the petitioners argued that they were entitled to the $20 compensation for every day of confinement, in addition to the $1 a day that they viewed as a token payment for small necessities while in jail.
While they pressed this broad definition of “attendance,” the petitioners also pointed to a narrower and more acute problem in administering the statute. Their amended complaint alleged that nonincarcerated witnesses are paid $20 for each day after they have been summoned to testify — even for those days they are not needed in court and simply wait in the relative comfort of their hotel rooms to be called. By contrast, witnesses in jail are paid only $1 a day when they are waiting to testify — even when the trial for which they have been detained is in progress. In short, the amended complaint alleged that the Government has construed the statute to mean that incarcerated witnesses must be physically present in the courtroom before they are eligible for the $20 daily compensation, but that nonincarcerated witnesses need not be similarly present to receive that amount.
In its answer, the Government conceded that each witness detained in custody is paid only $1 for every day of incarceration, and that the witness fee of $20 is paid only when such- a witness is actually in attendance in court. The Government defended this practice as required by the literal words of the statute, and argued that the statute, as so construed, is constitutional.
In an unreported order, the District Court granted the Government's motion for summary judgment, and the Court of Appeals for the Fifth Circuit affirmed. 452 F. 2d 951. The Court of Appeals concluded that the $20 witness fee is properly payable only to those witnesses who are “in attendance” or traveling to and from court, and not to those who are incarcerated to assure their attendance. So interpreted, the court upheld the statute as constitutional. We granted certiorari, 409 U. S. 841, to consider a question of seeming importance in the administration of justice in the federal courts.
I
Both the petitioners and the Government adhere to their own quite contrary interpretations of § 1821 — the petitioners maintaining that they are entitled to a $20 witness fee for every day of incarceration and the Government seeking to limit such payment to those days on which a detained witness is physically “in attendance” in court. We find both interpretations of the statute incorrect — the petitioners’ too expansive, the Government’s too restricted.
The statute provides to a “witness attending in any court of the United States” $20 “for each day's attendance.” This perforce means that a witness can be eligible for the $20 fee only when two requirements are satisfied — when there is a court in session that he is to attend, and when he is in necessary attendance on that court.
The petitioners’ interpretation of “attendance” as beginning with the first day of incarceration slights the statutory requirement that attendance be in court. A witness might be detained many days before the case in which he is to testify is called for trial. During that time, there is literally no court in session in which he could conceivably be considered to be in attendance. Over a century and a half ago Attorney General William Wirt rejected a similar construction of an almost identically worded law. He found that the then-current statute, which provided compensation to a witness “for each day he shall attend in court,” could not be construed to provide payment to incarcerated witnesses for every day of their detention:
“There is no court, except it be a court in session. There are judges; but they do not constitute a court, except when they assemble to administer the law. ... Now I cannot conceive with what propriety a witness can be said to be attending in court when there is no court, and will be no court for several months.
“To consider a witness who has been committed to jail becausfe he cannot give security to attend a future court, to be actually attending the court from the time of his commitment, and this for five months before there is any court in existence, would seem to me to be rather a forced and unnatural construction.” 1 Op, Atty. Gen. 424, 427.
The Government, on the other hand, would place a restrictive gloss on the statute’s requirement of necessary attendance; it maintains that the $20 compensation need be paid only for the days a witness is in actual physical attendance in court, and it concludes that a witness confined during the trial need only be paid for those days on which he is actually brought into the courtroom. But § 1821 does not speak in terms of “physical” or “actual” attendance, and we decline to engraft such a restriction upon the statute. Rather, the statute reaches those witnesses who have been summoned and are in necessary attendance on the court, in readiness to testify. There is nothing magic about the four walls of a courtroom. Once a witness has been summoned to testify, whether he waits in a witness room, a prosecutor’s office, a hotel room, or the jail, he is still available to testify, and it is that availability that the statute compensates. Non-incarcerated witnesses are compensated under the statute for days on which they have made themselves available to testify but on which their physical presence in the courtroom is not required — for example, where the trial is adjourned or where their testimony is only needed on a later day. We cannot accept the anomalous conclusion that the same statutory language imposes a requirement of physical presence in the courtroom on witnesses who have been confined. Attorney General Wirt concluded that language similar to that at issue here, did not require any such physical presence:
“But it was by no means my intention to authorize the inference . . . that, in order to entitle a witness to his per diem allowance under the act of Congress, it was necessary that he should be every day corporeally present within the walls of the court-room, and that the court must be every day in actual session. Such a puerility never entered my mind. My opinion simply was, and is, that before compensation could begin to run, the court must have commenced its session; the session must be legally subsisting, and the witness attending on the court — not necessarily in the court-room, but within its power, whenever it may require his attendance. ... I consider a witness as attending on court to the purpose of earning his compensation, so long as he is in the power of the court whensoever it may become necessary to call for his evidence, although he may not have entered the court-room until such call shall have been made; and I consider the court in session from the moment of its commencement until its adjournment sine die, notwithstanding its intermediate adjournments de die in diem." 1 Op. Atty. Gen., at 426-427.
We conclude that a material witness who has been incarcerated is entitled to the $20 compensation for every day of confinement during the trial or other proceeding for which he has been detained. On each of those days, the two requirements of the statute are satisfied — there is a court in session and the witness is in necessary attendance. He is in the same position as a nonincar-cerated witness who is summoned to appear on the first day of trial, but on arrival is told by the prosecutor that he is to hold himself ready to testify on a later day in the trial. The Government pays such a witness for every day he is in attendance on the court, and the statute requires it to pay the same per diem compensation to the incarcerated witness. Because the Court of Appeals upheld a construction of the statute that would allow the $20 to be paid to incarcerated witnesses only for those days they actually appear in the courtroom, its judgment must be set aside.
II
The petitioners argue that if § 1821 provides incarcerated witnesses only a dollar day for the period before the trial begins, then the statute is unconstitutional. We cannot agree.
As noted at the outset, the petitioners do not attack the constitutionality of incarcerating material witnesses, or the length of such incarceration in any particular case. Rather, they say that when the Government incarcerates material witnesses, it has “taken” their property, and that one dollar a day is not just compensation for this “taking” under the Fifth Amendment. Alternatively, they argue that payment of only one dollar a day before trial, when contrasted with the $20 a day paid to witnesses attending a trial, is a denial of due process of law.
But the Fifth Amendment does not require that the Government pay for the performance of a public duty it is already owed. See Monongahela Bridge Co. v. United States, 216 U. S. 177, 193 (modification of bridge obstructing river); United States v. Hobbs, 450 F. 2d 935 (Selective Service Act); United States v. Dillon, 346 F. 2d 633, 635 (representation of jndigents by court-appointed attorney); Roodenko v. United States, 147 F. 2d 752, 754 (alternative service for conscientious objectors); cf. Kunhardt & Co. v. United States, 266 U. S. 537, 540. It is beyond dispute that there is in fact a public obligation to provide evidence, see United States v. Bryan, 339 U. S. 323, 331; Blackmer v. United States, 284 U. S. 421, 438, and that this obligation persists no matter how financially burdensome it may be. The financial losses suffered during pretrial detention are an extension of the burdens borne by every witness who testifies. The detention of a material witness, in short, is simply not a “taking” under the Fifth Amendment, and the level of his compensation, therefore, does not, as such, present a constitutional question. “[I]t is clearly recognized that the giving of testimony and the attendance upon court or grand jury in order to testify are public duties which every person within the jurisdiction of the Government is bound to perform upon being properly summoned, and for performance of which he is entitled to no further compensation than that which the statutes provide. The personal sacrifice involved is a part of the necessary contribution of the individual to the welfare of the public.” Blair v. United States, 250 U. S. 273, 281.
Similarly, we are unpersuaded that the classifications drawn by § 1821 as we have construed it are so irrational as to violate the Due Process Clause of the Fifth Amendment. Cf. Bolling v. Sharpe, 347 U. S. 497, 499. The statute provides $20 per diem compensation to a witness who is in necessary attendance on a court, but that fee is payable to any witness, incarcerated or not. During the period that elapses before his attendance on a court, a witness who is not incarcerated gets no compensation whatever from the Government. An incarcerated witness, on the other hand, gets one dollar a day during that period, in addition to subsistence in kind.
We cannot say that there is no reasonable basis for distinguishing the compensation paid for pretrial detention from the fees paid for attendance at trial. Pretrial confinement will frequently be longer than the period of attendance on the court, and throughout that period of confinement the Government must bear the cost of food, lodging, and security for detained witnesses. Congress could thus reasonably determine that while some compensation should be provided during the pretrial detention period, a minimal amount was justified, particularly in view of the fact that the witness has a public obligation to testify. As the Court of Appeals correctly observed, “ [Governmental recognition of its interest in having persons appear in court by paying them for that participation in judicial proceedings, does not require that it make payment of the same nature and extent to persons who are held available for participation in judicial proceedings should it prove to be necessary. That the government pays for one stage does not require that it pay in like manner for all stages.” 452 F. 2d, at 955.
We do not pass upon the wisdom or ultimate fairness of the compensation Congress has provided for the pretrial detention of material witnesses. We do not decide “that a more just and humane system could not be devised.” Dandridge v. Williams, 397 U. S. 471, 487. Indeed, even though it opposed granting the petition for certiorari in the present case, the Government found it “obvious” that “the situation is not a satisfactory one,” and we were informed at oral argument that a legislative proposal to increase the per diem payment to detained witnesses will shortly be submitted by the Department of Justice to the Office of Management and Budget for review. But no matter how unwise or unsatisfactory the present rates might be, the Constitution provides no license to impose the levels of compensation we might think fair and just. That task belongs to Congress, not to us.
The judgment of the Court of Appeals is vacated, and the case is remanded to the District Court for further proceedings consistent with this opinion.
It is so ordered.
Fed. Rule Crim. Proc. 46 (b), at the time this case arose, and before Rule 46 was amended to conform to the Bail Reform Act of 1966, provided:
“Bail for Witness.
“If it appears by affidavit that the testimony of a person is material in any criminal proceeding and if it is shown that it may become impracticable to secure his presence by subpoena, the court or commissioner may require him to give bail for his appearance as a witness, in an amount fixed by the court or commissioner. If the person fails to give bail the court or commissioner may commit him to the custody of the marshal pending final disposition of the proceeding in which the testimony is needed, may order his release if he has been detained for an unreasonable length of time and may modify at any time the requirement as to bail.”
The statute provides in full:
“§ 1821. Per diem and mileage generally; subsistence.
“A witness attending in any court of the United States, or before a United States commissioner, or before any person authorized to take his deposition pursuant to any rule or order of a court of the United States, shall receive $20 for each day’s attendance and for the time necessarily occupied in going to and returning from the same, and 10 cents per mile for going from and returning to his place of residence. Regardless of the mode of travel employed by the witness, computation of mileage under this section shall be made on the basis of a uniform table of distances adopted by the Attorney General. Witnesses who are not salaried employees of the Government and who are not in custody and who attend at points so far removed from their respective residence as to prohibit return thereto from day to day shall be entitled to an additional allowance of $16 per day for expenses of subsistence including the time necessarily occupied in going to and returning from the place of attendance: Provided, That in lieu of the mileage allowance provided for herein, witnesses who are required to travel between the Territories and possessions, or to and from the continental United States, shall be entitled to the actual expenses of travel at the lowest first-class rate available at the time of reservation for passage, by means of transportation employed: Provided further, That this section shall not apply to Alaska.
“When a witness is detained in prison for want of security for his appearance, he shall be entitled, in addition to his subsistence, to a compensation of $1 per day.
“Witnesses in the district courts for the districts of Canal Zone, Guam, and the Virgin Islands shall receive the same fees and allowances provided in this section for witnesses in other district courcs of the United States.”
By way of illustration, the witness who sets out on Monday in order to be available to testify on Tuesday; but who is not actually called to the court for testimony until Friday; and who returns home on Saturday, will receive $20 for every day from Monday through Saturday. But the material witness who is incarcerated on Monday, held until Friday when he testifies, and then released, will receive one dollar for every day and an additional $20 only for Friday — the day he actually testifies.
Both parties bolster their statutory interpretations with arguments based upon the statutory language. The petitioners point out that incarcerated witnesses are not specifically excluded from those entitled to receive the $20 fee for attending court, though they are excluded from those entitled to the $16-a-day subsistence allowance. Hence, they conclude that Congress intended that they be eligible for the $20-per-day fee. But that argument proves no more than that Congress intended a detained witness to be eligible for the $20 fee for every day he is “attending” court; it does not indicate that Congress intended that every day of incarceration is the equivalent of a day attending court and compensable at the rate of $20 per day.
The Government supports its position by pointing out that the statute allocates to a detained witness $1 per day "in addition to his subsistence,” not $1 a day in addition both to subsistence and to a witness fee of $20. But it is difficult to give any weight to this argument, since the Government acknowledges that a detained witness is to be paid $20 a day at least for days of physical attendance in court. Therefore, according to the Government’s own interpretation, the $l-a-day clause can hardly be exclusive.
“And be it jurther enacted, That the compensation to jurors and witnesses, in the courts of the United States, shall be as follows, to wit: to each grand and other juror, for each day he shall attend in court, one dollar and twenty-five cents; and for travelling, at the rate of five cents per mile, from their respective places of abode, to the place where the court is holden, and the like allowance for returning; to the witnesses summoned in any court of the United States, the same allowance as is above provided for jurors.” Act of Feb. 28, 1799, c. 19, § 6, 1 Stat. 626.
Cf., e. g., Hunter v. Russell, 59 F. 964, 967-968; Whipple v. Cumberland Cotton Mfg. Co., 29 F. Cas. 933 (No. 17,515); Hance v. McCormick, 11 F. Cas. 401 (No. 6,009).
The Department of Justice regulations repeat the statutory directive that a witness is to be paid $20 for “each day’s attendance.” Department of Justice, United States Marshal’s Manual 340.14 (1971). There is no explicit requirement of physical presence in the courtroom.
The legislative history of the compensation provision is unenlightening. Though Congress early provided compensation for witnesses attending in the courts of the United States, no specific provision was made for incarcerated witnesses. See, e. g., Act of May 8, 1792, c. 36, § 3, 1 Stat. 277; Act of June 1, 1796, c. 48, § 2, 1 Stat. 492; Act of Feb. 28, 1799, c. 19, § 6, 1 Stat. 626. In 1853, Congress provided for payment to a witness of $1.50 a day while attending court, and specifically indicated that a detained witness was to be paid $1 a day over and above his subsistence. Act of Feb. 26, 1853, c. 80, § 3, 10 Stat. 167. In 1926, Congress eliminated the specific provision for compensation to detained witnesses and raised the per diem compensation for attendance in court. Act of Apr. 26, 1926, c. 183, §§ 1-3, 44 Stat. 323-324.
In the following two decades, Congress changed the levels of compensation but did not specifically provide for compensation to detained witnesses. See Act of June 30, 1932, c. 314, § 323, 47 Stat. 413; Act of Mar. 22, 1935, c. 39, § 3, 49 Stat. 105; Act of Dec. 24, 1942, c. 825, § 1, 56 Stat. 1088. When the Judicial Code was revised in 1948, the provision for per diem compensation to detained witnesses was again absent, Act of June 25, 1948, c. 646, § 1821, 62 Stat. 950, but was added the following year, Act of May 24, 1949, c. 139, § 94, 63 Stat. 103, with the explanation by the House Committee on the Judiciary that it had been “inadvertently omitted.” H. R. Rep. No. 352, 81st Cong., 1st Sess., 16. By a separate measure, witness fees were increased. Act of May 10, 1949, c. 96, 63 Stat. 65. While the per diem fee, the subsistence fee, and the travel allowance have all been increased, the $1 a day for incarcerated witnesses has remained constant. See Act of Aug. 1, 1956, c. 826, 70 Stat. 798; Act of Mar. 27, 1968, Pub. L. 90-274, § 102 (b), 82 Stat. 62.
The petitioners urge that this history of steadily increasing fees at least indicates a congressional intent to compensate witnesses fully for their lost time and income, and that since they suffer these losses throughout the period of incarceration they ought to receive the $20 for every day of confinement. But Congress recognized that witness fees could not fully compensate witnesses for their lost time or income. See, e. g., S. Rep. No. 891, 90th Cong., 1st Sess., 36; S. Rep. No. 187, 81st Cong., 1st Sess., 2. The petitioners point to no hint in any of the reports on the various changes in compensation levels which could justify the conclusion that Congress intended to provide more than $1 a day to detained witnesses for the period of their pretrial confinement.
It was also error to affirm the summary judgment for the Government because there was a genuine issue of material fact whether the petitioners had ever been paid for the days that they actually attended court. See Fed. Rule Civ. Proc. 56 (c); Arenas v. United States 322 U. S. 419, 432-434; Sartor v. Arkansas Natural Gas Corp., 321 U. S. 620, 623-629. They alleged in their amended complaint that on many occasions they testified for the Government and were not paid $20 a day for such testimony. The Government agreed that they were entitled to that compensation, but contended in its answer that they had been so paid. No affidavits or other evidence was submitted to support that contention, and the Court of Appeals in affirming summary judgment for the Government did not comment on this clear factual dispute.
Since a remand is required, we also note that the District Court never explicitly ruled on the petitioners’ motion to have this suit declared a class action under Fed. Rule Civ. Proc. 23, and the Court of Appeals did not discuss the issue. It will, of course, be appropriate on remand for the District Court to determine whether this suit was properly brought as a class action, and we accordingly express no view on that issue.
See Stein v. New York, 346 U. S. 156, 184 (“The duty to disclose knowledge of crime ... is so vital that one known to be innocent may be detained, in the absence of bail, as a material witness”); Barry v. United States ex rel. Cunningham, 279 U. S. 597, 616-618.
“[I]t may be a sacrifice of time and labor, and thus of ease, of profits, of livelihood. This contribution is not to be regarded as a gratuity, or a courtesy, or an ill-required favor. It is a duty not to be grudged or evaded. Whoever is impelled to evade or to resent it should retire from the society of organized and civilized communities, and become a hermit. He who will live by society must let society live by him, when it requires to.” 8 J. Wigmore, Evidence § 2192, p. 72 (J. McNaughton rev. 1961).
There is likewise no substance to the petitioners’ argument that the $l-a-day payment is so low as to impose involuntary servitude prohibited by the Thirteenth Amendment. Cf. Griffin v. Breckenridge, 403 U. S. 88, 104-105; Jones v. Alfred H. Mayer Co., 392 U. S. 409, 437-444.