D, a Virginia corporation with its principal place of business in Virginia, entered into a contract with the United States Army Corps of Engineers to construct a child-development center at Fort Hood in the Western District of Texas. D then entered into a subcontract with J-Crew Management, Inc. (P), a Texas corporation, for work on the project. The subcontract included a forum-selection clause, which stated that all disputes between the parties “‘shall be litigated in the Circuit Court for the City of Norfolk, Virginia, or the United States District Court for the Eastern District of Virginia, Norfolk Division. A dispute over payment arose, and P sued D in the Western District of Texas, invoking that court’s diversity jurisdiction. D moved to dismiss the suit, arguing that the forum-selection clause rendered venue in the Western District of Texas “wrong” under §1406(a) and “improper” under Federal Rule of Civil Procedure 12(b)(3). D moved to transfer the case to the Eastern District of Virginia under §1404(a). P opposed these motions. The District Court denied both motions. It first concluded that §1404(a) is the exclusive mechanism for enforcing a forum-selection clause that points to another federal forum. It then held that D bore the burden of establishing that a transfer would be appropriate under §1404(a) and that the court would “consider a nonexhaustive and nonexclusive list of public and private interest factors,” of which the “forum-selection clause [was] only one such factor.” The Court held that D had failed to carry its burden of showing that transfer “would be in the interest of justice or increase the convenience to the parties and their witnesses.” D petitioned the Court of Appeals for a writ of mandamus directing the District Court to dismiss the case under §1406(a) or to transfer the case to the Eastern District of Virginia under §1404(a). It denied the petition. The Court of Appeals agreed with the District Court that §1404(a) is the exclusive mechanism for enforcing a forum-selection clause that points to another federal forum when venue is otherwise proper in the district where the case was brought. The Supreme Court granted certiorari. D contends that a party may enforce a forum-selection clause by seeking dismissal of the suit under §1406(a) and Rule 12(b)(3).