
628 F.Supp.2d 535 (2009)
FAMILIES FOR FREEDOM et al., Plaintiffs,
v.
Janet NAPOLITANO, Secretary of Homeland Security, Defendant.[1]
No. 08 Civ. 4056 (DC).
United States District Court, S.D. New York.
June 25, 2009.
*536 Jerome N. Frank Legal Services Organization by Michael Wishnie, Esq., Anand Balakrishnan, Jeffrey Kahn, Lindsay Nash, Law Student Interns, New Haven, CT, Attorneys for Plaintiffs.
Lev L. Dassin, Esq., Acting United States Attorney for the, Southern District of New York by David Bober, Esq., Assistant United States Attorney, New York, NY, for Defendant.

MEMORANDUM DECISION
CHIN, District Judge.
In this case, plaintiffstwo immigrant advocacy organizations and two former immigration detaineescontend that substandard and abusive conditions exist in facilities that house detained immigrants. Consequently, on January 25, 2007, plaintiffs petitioned the Department of Homeland Security ("DHS") pursuant to the Administrative Procedure Act, 5 U.S.C. § 551 et seq. (the "APA"), to promulgate regulations to govern the conditions in immigration detention facilities. When DHS still had not responded more than a year later, plaintiffs sued in this Court under the APA, seeking an order requiring DHS to decide their petition, or, in the alternative, declaring that DHS's failure to respond constituted a constructive denial of their petition in violation of the APA.
DHS still has not, as of this date, granted or denied plaintiffs' petition.
DHS moves to dismiss the complaint pursuant to Federal Rules of Civil Procedure 12(b)(1) and (6) for lack of subject matter jurisdiction and standing, and for failure to state a claim upon which relief may be granted. For the reasons set forth below, DHS's motion is denied. Moreover, I conclude that DHS's delay of almost two-and-one-half years is unreasonable as a matter of law, and order DHS to decide plaintiffs' petition within thirty days.

BACKGROUND

A. Facts

The underlying facts alleged in the complaint are assumed to be true for purposes of this motion. The procedural facts are not in dispute.

1. Parties

Plaintiff Families for Freedom is a nonprofit organization based in New York that serves immigrants and their families. (Compl. ¶ 14). Plaintiff National Immigration Project of the National Lawyer's Guild is a non-profit organization based in Boston that defends immigrants facing removal and incarceration. (Id. ¶ 12). Plaintiff Rafiu Abimbola is a Nigerian national who was held in DHS detention facilities for more than six years. (Id. *537 ¶ 10). Plaintiff Carnal Marchabeyoglu is a lawful permanent resident who was detained by DHS several times between 1998 and 2004. (Id. ¶ 11).
DHS is an agency of the United States responsible for, inter alia, federal immigration policy. (Id. ¶ 17). Immigration and Customs Enforcement ("ICE") is a division within DHS responsible for, inter alia, detaining non-citizens accused of immigration violations. (Id. ¶ 18).

2. DHS's Detention Standards

ICE operates numerous detention facilities, either itself or through private contractors. It also contracts with state, county, and local jails to house detained immigrants. (Id. ¶¶ 19-20). The detention of immigrants in facilities controlled by different entities "has led to inconsistent conditions of confinement, substandard and abusive detention conditions, and widespread detainee mistreatment." (Id. ¶ 33). Immigrant detainees have been subjected to verbal and physical abuse and denied adequate medical care. (Id. ¶ 34).
The Immigration Naturalization Service ("INS"), the predecessor to ICE, acknowledged the problems with the immigrant detention system, and in 1998 adopted detention standards. (Id. ¶ 35). These standards were inadequate, however, because they did not apply to detainees in state and local jailswhere most of the problems occurand so, in 2000, INS adopted new standards. (Id. ¶¶ 36, 39). The new standards applied to state and local jails holding immigration detainees, but only those that held detainees for more than 72 hours. (Id. ¶ 40).
In 2003, ICE issued a "Detention and Removal Strategic Plan for 2003-2012" to address continuing problems with detention facilities. (Id. ¶ 42). Plaintiffs allege that the 2003 plan is inadequate, however, because it only provides guidelinesas opposed to mandatory standardsfor detention facilities, and did not establish any enforcement mechanism. (Id. ¶¶ 44-46). Moreover, ICE does not even train its employees based on the guidelines. (Id. ¶ 48). The 2003 plan is the most recent set of guidelines immigration authorities have issued regarding standards in detention facilities.
Since 2003, problems in detention facilities have been persistent and widespread. In a 2006 report, the DHS Office of Inspector General issued a report detailing significant problems in ICE detention facilities. (Id. ¶¶ 53-57). The report found, for example, that at a number of facilities, officials did not respond to non-emergency medical requests by detainees within the time required by DHS guidelines. (Id. ¶ 55). Problems with detainee medical care have also been chronicled by the news media, which have reported a number of instances in which immigration detainees have been seriously injured or died while in the custody of immigration authorities. See, e.g., Dana Priest & Amy Goldstein, Suicide Points to Gaps in Treatment: Errors in Psychiatric Diagnoses and Drugs Plague Strained Immigration System, Wash. Post, May 13, 2008, at A1; Nina Bernstein, Ill and In Pain, Detainee Dies in U.S. Hands, N.Y. Times, Aug. 13, 2008, at A1; Nina Bernstein, Another Jail Death, and Mounting Questions, N.Y. Times, Jan. 28, 2009, at A14.

3. Plaintiffs' Petition for Rulemaking

In light of these persistent problems in detention facilities, on January 25, 2007, plaintiffs petitioned DHS, pursuant to 5 U.S.C. § 553(e),[2] to promulgate binding *538 regulations governing detention conditions and standards for detained immigrants. (Compl. ¶ 69). On January 31, 2007, the American Bar Association (the "ABA") sent DHS a letter "in strong support" of plaintiffs' petition. (Bober Decl. Ex. B).
On March 19, 2007, DHS responded to the ABA's letter, stating that it would "consider" the petition, and went on to discuss in general terms DHS's efforts to ensure adequate conditions in detention facilities. (Bober Decl. Ex. C). DHS did not, however, respond directly to plaintiffs.

B. Procedural History

Plaintiffs filed the complaint in this action on April 30, 2008, invoking the Court's jurisdiction under 28 U.S.C. § 1331, and asserting two claims. First, they claim that DHS's delay in responding to their petition was unreasonable and asked the Court, pursuant to Section 706(1) of the APA, to compel DHS to respond. (Compl. ¶¶ 82-87). Second, they claim that DHS's failure to respond constituted a constructive denial that was "arbitrary, capricious, an abuse of discretion, or otherwise not in accordance with law." (Id. ¶¶ 88-92).
On July 15, 2008, two-and-one-half months after plaintiffs filed this lawsuit, and almost eighteen months after plaintiffs submitted their petition, DHS finally communicated with plaintiffs. (Bober Decl. Ex. D). DHS wrote a letter to plaintiffs stating that "DHS and ICE continue to study the possibility of commencing a rulemaking action" and discussing, in general terms, DHS's efforts to improve conditions in detention facilities. (Id.). While the letter is a "response" within the literal meaning of the word, the letter does not grant or deny plaintiffs' petition.
DHS moved to dismiss on October 15, 2008. I held oral argument on December 18, 2008, and reserved decision, as I urged the parties to try to resolve the matter.
On December 30, 2008, DHS informed the Court that it would issue a final decision on plaintiffs' petition by January 16, 2009, and requested that the Court refrain from ruling on DHS's motion in the interim. On January 16, 2009, DHS requested an additional five days to issue its decision. On January 21, 2009, DHS informed the Court that, while its previous letters were accurate representations of DHS's position "at the time," it could neither meet the January 21, 2009 deadline nor "commit to a specific date by which it will render a final decision on plaintiffs' petition." (1/21/09 Ltr. at 1).

DISCUSSION
DHS moves to dismiss on three grounds. First, it argues that plaintiffs' complaint amounts to a "broad programmatic attack" of agency action that is precluded from judicial review under the APA. Second, it argues that there is no "final action" for the Court to review because DHS has' not yet responded to plaintiffs' petition. Finally, DHS argues that plaintiffs lack standing to pursue their claims.
DHS's arguments are all directed at plaintiffs' second cause of action. Plaintiffs, in opposition to DHS's motion to dismiss, argue principally that the relief they seek is on their first cause of action that DHS either grant or deny their petition. They argue that, under 5 U.S.C. § 555(b), an agency presented with a petition for rulemaking must, at a minimum, respond to that petition, and that the petitioning party has standing to compel a response unreasonably withheld.
For the reasons that follow, DHS's motion to dismiss is denied. Moreover, I conclude that plaintiffs are entitled to *539 judgment in their favor as to the first count of their complaint. Specifically, I conclude that DHS is required to grant or deny plaintiffs' petition, and that its delay in doing so is unreasonable as a matter of law.
Because I find for plaintiffs on the first count of their complaint, I dismiss as moot, and without prejudice, the second count.

A. DHS's Motion to Dismiss

Courts differ as to whether a motion to dismiss an action brought under 5 U.S.C. § 706(1) is based on lack of standing, subject matter jurisdiction, or failure to state a claim. See Norton v. S. Utah Wilderness Alliance, 542 U.S. 55, 73, 124 S.Ct. 2373, 159 L.Ed.2d 137 (2004) (upholding district court's dismissal for lack of subject matter jurisdiction); Ctr. for Biological Diversity v. Veneman, 394 F.3d 1108, 1113 (9th Cir.2005) (affirming dismissal for lack of standing); Friends of the Earth v. U.S. Dep't of Interior, 478 F.Supp.2d 11, 23 (D.D.C.2007) ("A dismissal for failure to satisfy the APA's requirements for judicial review of agency action is thus a dismissal for failure to state a claim under Rule 12(b)(6), not a dismissal for want of subject matter jurisdiction under Rule 12(b)(1)....").
Here, DHS cites all three grounds as the basis of its motion to dismiss. In essence, however, DHS is moving to dismiss for failure to state a claim upon which relief can be granted. At oral argument, DHS concededcorrectlythat plaintiffs, as the parties who submitted a petition for rulemaking to DHS, have standing as to their first cause of action. (See 12/18/08 Tr. at 22). As to subject matter jurisdiction, it is conferred by 28 U.S.C. § 1331, as this case arises under a federal statute namely, the APA. See 28 U.S.C. § 1331 ("The district courts shall have original jurisdiction of all civil actions arising under the Constitution, laws, or treaties of the United States."). Moreover, the Court also has subject matter jurisdiction over this case because the United States is a defendant. See 28 U.S.C. § 1346(a)(2) ("The district courts shall have original jurisdiction ... of ... [a]ny other civil action or claim against the United States, not exceeding $10,000 in amount, founded either upon the Constitution, or any Act of Congress."). Accordingly, the Court treats DHS's motion as one to dismiss under 12(b)(6).
I now turn to the two claims in plaintiffs' complaint.

B. Plaintiffs' First Claim

Not only do I conclude that plaintiffs have stated a claim as to their first cause of action, I conclude that they are entitled to judgment in their favor as a matter of law.[3]

1. Is DHS Required to Respond to a Petition for Rulemaking?

The APA expressly grants any "interested person" the right to petition a federal agency "for the issuance, amendment, or repeal of a rule." See 5 U.S.C. § 553(e). A federal agency presented with such a petition is required to decide the petition, "within a reasonable time." See 5 U.S.C. § 555(b) ("With due regard for the convenience and necessity of the parties or their representatives and within a reasonable time, each agency shall proceed to conclude a matter presented to it.") (emphasis added); In re Am. Rivers & Idaho *540 Rivers United, 372 F.3d 413, 418-19 (D.C.Cir.2004) (holding that, under APA, federal agency must respond to rulemaking petition); Richard J. Pierce, Jr., Administrative Law Treatise § 6.10 (4th ed. 2002) ("At a minimum, the right to petition for rulemaking entitles a petitioning party to a response to the merits of the petition."). If an agency fails to respond to a petition, courts have the authority to "compel agency action unlawfully withheld or unreasonably delayed." 5 U.S.C. § 706(1).
Thus, it is clear that DHS is required to at least definitively respond to plaintiffs' petitionthat is, to either deny or grant the petition. Indeed, DHS conceded this point at oral argument. (See 12/18/08 Tr. at 6). It is also undisputed that, as of this writing, DHS has neither denied nor granted plaintiffs' petition. (DHS Mem. at 1 ("DHS has neither granted nor denied the petition."); 12/18/08 Tr. at 6; 1/21/09 Ltr. at 1 (referencing fact that DHS has not issued a final decision on petition)). The only question remaining, then, is whether DHS's delay in answering the petition is unreasonable as a matter of law.

2. Is DHS's Delay Unreasonable Under the APA?

In Telecommunications Research and Action Center v. FCC, 750 F.2d 70 (D.C.Cir.1984) ("TRAC"), the District of Columbia Circuit established a six-factor test for courts to consider in determining whether a federal agency's failure to respond to a petition is unreasonable under the APA. The TRAC factors are as follows:
(1) the time agencies take to make decisions must be governed by a rule of reason; (2) where Congress has provided a timetable or other indication of the speed with which it expects the agency to proceed in the enabling statute, that statutory scheme may supply content for this rule of reason; (3) delays that might be reasonable in the sphere of economic regulation are less tolerable when human health and welfare are at stake; (4) the court should consider the effect of expediting delayed action on agency activities of a higher or competing priority; (5) the court should also take into account the nature and extent of the interests prejudiced by delay; and (6) the court need not find any impropriety lurking behind agency lassitude in order to hold that agency action is unreasonably delayed.
Id. at 80. The D.C. Circuit's decision in TRAC has been widely followed by federal courts. See, e.g., Brower v. Evans, 257 F.3d 1058, 1068 (9th Cir.2001) (following TRAC); Wellesley v. FERC, 829 F.2d 275, 277 (1st Cir.1987) (same); Assadzadeh v. Mueller, No. 07 Civ. 2676, 2007 WL 3252771, at *5, 2007 U.S. Dist. LEXIS 80915, at *15 (E.D.Pa. Oct. 30, 2007) (following TRAC and referring to it as "seminal" test for unreasonable delay); Natural Res. Def. Council v. Fox, 93 F.Supp.2d 531, 543 (S.D.N.Y.2000) (following TRAC).
Applying the TRAC factors, I conclude that DHS's nearly two-and-one-half year delay in deciding plaintiffs' petition is unreasonable as a matter of law.
As to the first factorwhich the D.C. Circuit has characterized as the "most important," In re Core Communs., Inc., 531 F.3d 849, 855 (D.C.Cir.2008)applying a rule of reason compels the conclusion that DHS's delay is unreasonable. The D.C. Circuit has held that, while "[t]here is no per se rule as to how long is too long to wait for agency action, [] a reasonable time for agency action is typically counted in weeks or months, not years." In re Am. Rivers & Idaho Rivers United, 372 F.3d at 419 (internal citation and quotations omitted). It is unreasonable for DHS to take years to decide whether it intends to commence rulemaking regarding standards for detention facilities, given *541 the gravity of the problems plaintiffs describe. Its delay in even responding to plaintiffs "saps the public's confidence in an agency's ability to discharge its responsibilities," and therefore runs afoul of the APA. Potomac Elec. Power Co. v. Interstate Commerce Comm'n, 702 F.2d 1026, 1034 (D.C.Cir.1983).
The second factor is neutral, as there is no indication that Congress has established a timetable within which DHS must render a decision.
As to the third factor, concerns of human health and welfare are undeniably at stake. Indeed, plaintiffs allege that detainees in DHS custody are dying as a result of the substandard conditions under which they are held. Plaintiffs' claim clearly implicates concerns of human health and welfare, making DHS's delay in responding to the petition that much more egregious. See Fox, 93 F.Supp.2d at 544 (court should only compel agency action under 706(1) where delay is "`egregious'") (quoting TRAC, 750 F.2d at 79).
As to the fourth factor, expediting DHS's decision in this respect surely would not interfere with any "agency activities of a higher or competing priority," TRAC, 750 F.2d at 80, for the concerns raised by plaintiffs are of the utmost importance.
As to the fifth factor, as discussed in the context of factor three, at issue here is the health and welfare of detainees in DHS custody, and thus the risk of prejudice due to further delay is severe.
As to the sixth factor, there is no suggestion that there has been any impropriety, and thus this factor is neutral.
DHS argues that its delay in deciding plaintiffs' petition is not unreasonable, and it cites cases in which courts have held that delays of several years are reasonable. DHS acknowledges, however, that there is no per se rule as to whether a given delay is reasonable, and that courts must determine the reasonableness of delay based on the totality of the circumstances. (DHS Reply at 6 n. 2).
Here, considering the TRAC factors and the totality of the circumstances of this case, I hold, as a matter of law, that DHS's almost two-and-one-half year delay is unreasonable.

3. Remedy

"When an administrative agency simply refuses to act upon an application, the proper remedyif anyis an order compelling agency action, not plenary review of the application by a district court." McHugh v. Rubin, 220 F.3d 53, 61 (2d Cir.2000). Accordingly, I hereby order DHS to grant or deny plaintiffs' complaint within thirty days of entry of judgment.

C. Plaintiffs' Second Claim

Because I hold that DHS has not yet responded to plaintiffs' petition within the meaning of the APA, plaintiffs' claim that DHS's response constitutes a constructive denial is dismissed, without prejudice, as moot.

CONCLUSION
For the foregoing reasons, DHS's motion to dismiss is denied. DHS is hereby ordered to respond to plaintiffs' petition within thirty days. Plaintiffs' second claim is dismissed, without prejudice, as moot. The Clerk of Court is directed to enter, judgment accordingly and to close the case.
SO ORDERED.

ORDER
On June 25, 2009, I issued a Memorandum Decision (the "Decision") denying the motion to dismiss by defendant Department *542 of Homeland Security ("DHS"), granting judgment in favor of plaintiffs on their first claim, dismissing their second claim, and ordering DHS to grant or deny plaintiffs' petition within 30 days.
Upon reflection, I believe the Decision should have addressed the fact that the Court entered judgment for plaintiffs without formally notifying DHS of the possibility that it would do so. I conclude, however, that DHS had adequate notice. The parties addressed the reasonableness of DHS's delay in their briefs, and at oral argument the possibility of entering judgment in plaintiffs' favor on their first claim was raised several times. (See 12/18/08 Tr. 11, 14). Moreover, plaintiffs argued in their opposition brief that the delay was unreasonable as a matter of law, and in its reply papers, DHS disputed that proposition.
In addition, it is hard to imagine what DHS can offer by way of a reasonable explanation for the delay, in view of the factors discussed in the Decision. Moreover, DHS has been on notice of the concerns underlying plaintiffs' complaint for at least two-and-one-half years. Finally, on December 30, 2008, DHS announced that it would issue a final decision by January 16, 2009, and by letter dated January 16, 2009, it advised that it would issue a final decision by January 21, 2009. Although DHS did not issue a final decision in the end, these letters make it clear that it could do so if it were willing to focus on the issue.
To the extent that DHS wishes to be heard further on the issue of the reasonableness of the delay, it may move for reconsideration of the Decision within ten days.
SO ORDERED.
NOTES
[1]  This lawsuit was commenced against Michael Chertoff, the former Secretary of Homeland Security. Pursuant to Rule 25(d) of the Federal Rules of Civil Procedure, current Secretary Janet Napolitano has been substituted for Chertoff as the defendant in this action.
[2]  Section 553(e) provides that "[e]ach agency shall give an interested person the right to petition for the issuance, amendment, or repeal of a rule."
[3]  A district court has the inherent authority to undertake an independent review of the record before it and enter judgment in favor of either party. See First Fin. Ins. Co. v. Allstate Interior Demolition Corp., 193 F.3d 109, 115 (2d Cir.1999) (holding, in context of summary judgment, that court may enter judgment for either moving or non-moving party).
