
630 F.3d 321 (2010)
Modesto CRUZ, Appellant
v.
COMMISSIONER OF SOCIAL SECURITY.
No. 10-1494.
United States Court of Appeals, Third Circuit.
Submitted Pursuant to Third Circuit LAR 34.1(a) September 17, 2010.
Filed: October 22, 2010.
*322 Robert Savoy, Esq., Trevose, PA, for Appellant.
Lori R. Karimoto, Esq., Social Security Administration, Philadelphia, PA, for Appellee.
Before: SCIRICA, RENDELL and FISHER, Circuit Judges.

OPINION OF THE COURT
FISHER, Circuit Judge.
Modesto Cruz appeals from an order denying his motion for attorney's fees under the Equal Access to Justice Act ("EAJA"), 28 U.S.C. § 2412, and an order denying his motion to alter or amend judgment. For the reasons stated herein, we will affirm.

I.
On August 22, 1997, Mr. Cruz applied for Disability Insurance Benefits under Title II of the Social Security Act, 42 U.S.C. § 401 et seq., claiming neck and back impairments. His claim for benefits was denied. Thereafter, Mr. Cruz timely requested a hearing before an Administrative Law Judge ("ALJ"). Following the hearing, the ALJ denied Mr. Cruz's request for review. The Appeals Council denied his request for further review.
On November 19, 2001, Mr. Cruz filed a civil action. After reviewing a motion for summary judgment filed by Mr. Cruz, the District Court granted the motion in part, and remanded the matter to the Commissioner of the Social Security Administration for consideration of all relevant medical evidence in determining Mr. Cruz's residual functional capacity and ability to return to past relevant work.
On remand, Mr. Cruz sought disability benefits for the period from November 23, 1996 through November 15, 2000. On November 15, 2000, Mr. Cruz resumed working for his previous employer and continued until 2005 when the employer relocated. The ALJ held a hearing and determined that Mr. Cruz was not disabled and that he could return to his past relevant work. Mr. Cruz appealed this decision to the Appeals Council. The Appeals Council declined to review the ALJ's decision.
On March 2, 2006, Mr. Cruz filed a second civil action. The Commissioner filed an Uncontested Motion for Remand requesting that the ALJ: (1) reevaluate Mr. Cruz's residual functional capacity considering the applicable state agency opinions; (2) address the treating physician's opinions that Mr. Cruz was disabled and provide a rationale for the weight assigned those opinions; (3) obtain vocational expert testimony to determine the physical and mental demands of Mr. Cruz's past work; and (4) if Mr. Cruz was unable to perform his past work, determine if there are other jobs Mr. Cruz could perform. The motion was granted.
The ALJ convened a third hearing to consider the case following remand. At this hearing, Mr. Cruz submitted evidence from Dr. Melanie Ice, his treating physician. Significant to this appeal, Mr. Cruz *323 introduced Dr. Ice's April 2007 Medical Source Statement Concerning Nature and Severity of Impairments ("Dr. Ice's Statement"). The statement referred to the closed period from November 23, 1996 to November 15, 2000, and supported a finding that Mr. Cruz was disabled. The ALJ denied benefits for this closed period and granted benefits from November 7, 2005 forward.
On January 11, 2008, Mr. Cruz filed a third civil action seeking judicial review of the final decision of the Commissioner of the Social Security Administration denying his claim for Disability Insurance Benefits under Title II of the Social Security Act, 42 U.S.C. § 401, et seq. Mr. Cruz sought benefits for the closed period from November 23, 1996 to November 15, 2000. Both parties consented to jurisdiction before the Magistrate Judge. In his claim, Mr. Cruz argued that the Administrative Law Judge ("ALJ") misinterpreted a statement submitted by his treating physician, Dr. Melanie Ice. Dr. Ice's April 2007 Medical Source Statement Concerning Nature and Severity of Impairments ("Dr. Ice's Statement") referred to the closed period from November 23, 1996 to November 15, 2000, and supported a finding that Mr. Cruz was disabled. In its decision to deny benefits for this period, the ALJ cited to Dr. Ice's Statement but applied it to Mr. Cruz's benefits claim for the period from 2005 onward.
On January 30, 2009, the Magistrate Judge issued an order granting in part and denying in part Mr. Cruz's request for review and remanded the case to the ALJ. According to the Magistrate Judge, the ALJ misread Dr. Ice's Statement as applying from 2005 onward instead of the closed period from 1996 to 2000. Therefore, the Magistrate Judge remanded the case to the ALJ for a determination based on a proper reading of Dr. Ice's Statement.
On March 17, 2009, following remand, Mr. Cruz filed a motion for attorney's fees under the EAJA, 28 U.S.C. § 2412. Mr. Cruz alleged that he was entitled to attorney's fees because the ALJ improperly considered Dr. Ice's Statement and the Commissioner's defense of the ALJ's decision was not substantially justified. According to the Commissioner, the ALJ realized that Dr. Ice's Statement applied to the closed period from 1996 to 2000. The Commissioner maintained, however, that the ALJ found it more relevant to the period from 2005 onward.
On June 22, 2009, the Magistrate Judge denied Mr. Cruz's motion for attorney's fees. Viewing the totality of the circumstances, the Magistrate Judge concluded the ALJ reasonably analyzed the facts of the case. Furthermore, in its examination of the Commissioner's position, the Magistrate Judge focused on the inconsistencies in Dr. Ice's notes for the closed period from November 1996 to November 2000. Contrary to Dr. Ice's Statement, her other notes from this time frame did not support a disability finding. Considering these notes and other medical records, the Magistrate Judge found that the Commissioner's position regarding the ALJ interpretation of Dr. Ice's Statement was substantially justified. Accordingly, the Magistrate Judge denied Mr. Cruz's motion for attorney's fees.
On July 7, 2009, Mr. Cruz filed a motion to alter or amend judgment. Mr. Cruz alleged the Magistrate Judge improperly denied his motion for costs, improperly intruded upon the Commissioner's role in the fact finding process by making a credibility determination as to Dr. Ice's Statement, and erred by failing to apply Third Circuit precedent.
On December 18, 2009, the Magistrate Judge denied the motion. First, addressing Mr. Cruz's claim for costs, the Magistrate *324 Judge interpreted the applicable statutory language and explained that, given the broad statutory discretion in awarding costs, it did not commit clear error of law. Furthermore, the Magistrate Judge found it had not made a credibility determination as to Dr. Ice's Statement. Instead, the Magistrate Judge concluded it correctly applied Third Circuit precedent for assessing EAJA claims.
On April 21, 2010, Mr. Cruz timely filed the instant appeal alleging that the Magistrate Judge abused its discretion by denying his claim for attorney's fees pursuant to 28 U.S.C. § 2412(d)(1)(A) and costs pursuant to 28 U.S.C. § 2412(a)(1).

II.
The Magistrate Judge exercised jurisdiction pursuant to 42 U.S.C. § 405(g). We have jurisdiction over this appeal pursuant to 28 U.S.C. § 1291. "The district court's determination of substantial justification in a suit under the EAJA is reviewed for abuse of discretion." Morgan v. Perry, 142 F.3d 670, 682 (3d Cir.1998) (citing Pierce v. Underwood, 487 U.S. 552, 560, 108 S.Ct. 2541, 101 L.Ed.2d 490 (1988)). According to this standard, "[a]n abuse of discretion arises when the district court's decision `rests upon a clearly erroneous finding of fact, an errant conclusion of law or an improper application of law to fact.'" Morgan, 142 F.3d at 682 (quoting Hanover Potato Prods., Inc. v. Shalala, 989 F.2d 123, 127 (3d Cir.1993)). Likewise, "[a]n abuse of discretion can also occur `when no reasonable person would adopt the district court's view.'" Morgan, 142 F.3d at 683 (citation omitted). As a result, "we will not interfere with the district court's exercise of discretion `unless there is a definite and firm conviction that the court ... committed a clear error of judgment in the conclusion reached upon a weighing of the relevant factors.'" Id. (citation omitted).

III.
Mr. Cruz advances two arguments on appeal. First, Mr. Cruz contends that the Magistrate Judge abused its discretion by finding that the Commissioner's position was substantially justified, and therefore he is entitled to attorney's fees under the EAJA, 28 U.S.C. § 2412(d)(1)(A). Second, Mr. Cruz argues that the Magistrate Judge abused its discretion in denying his claim for costs other than attorney's fees pursuant to 28 U.S.C. § 2412(a)(1). We address each argument in turn.

A.
Pursuant to the EAJA, "a court shall award to a prevailing party . . . fees and other expenses ... incurred by that party ... unless the court finds that the position of the United States was substantially justified or that special circumstances make an award unjust." 28 U.S.C. § 2412(d)(1)(A) (2006). The Supreme Court has defined substantial justification under the EAJA as "justified in substance or in the mainthat is, justified to a degree that could satisfy a reasonable person." Pierce, 487 U.S. at 565, 108 S.Ct. 2541. In EAJA claims, the government bears the burden of demonstrating substantial justification. See Hanover, 989 F.2d at 128 (citation omitted). To satisfy this burden and defeat a prevailing party's application for fees, the government must establish that there is substantial justification for its position by demonstrating "(1) a reasonable basis in truth for the facts alleged; (2) a reasonable basis in law for the theory it propounded; and (3) a reasonable connection between the facts alleged and the legal theory advanced." Morgan, 142 F.3d at 684 (citation omitted). Furthermore, "a court cannot assume that *325 the government's position was not substantially justified simply because the government lost on the merits." Id. at 685. Rather, when deciding whether the government is substantially justified, courts should determine whether the government's position has a reasonable basis in both fact and law. See id. at 684.
Mr. Cruz argues that the Magistrate Judge abused its discretion when it found the Commissioner's position was substantially justified and denied his claim for attorney's fees. Specifically, Mr. Cruz claims that the Commissioner's defense of the ALJ's treatment of Dr. Ice's Statement had no basis in fact or law and, therefore, was not substantially justified. We disagree.
In proceedings below, the Magistrate Judge correctly analyzed the Commissioner's position under the three-step substantial justification test set forth in Morgan. First, the Magistrate Judge noted that the Commissioner did not believe that the ALJ misread the dates of Dr. Ice's Statement. Rather, the Commissioner reasonably maintained that the ALJ knew that Dr. Ice's Statement applied to the period from November 1996 to November 2000, but determined that it better represented the period from 2005 onward. Second, the Magistrate Judge reviewed the record as a whole, including Dr. Ice's inconsistent notes and other medical records, and determined that it supported a finding of no disability for the closed period. As such, the Magistrate Judge found that the Commissioner's position had a reasonable basis in law. Third, after examining the Commissioner's position and the record, the Magistrate Judge found a reasonable connection between the facts and the Commissioner's legal theory. In concluding that the Commissioner was substantially justified, the Magistrate Judge correctly applied the relevant facts to the law and therefore did not "commit a clear error of judgment." Id. at 683. Accordingly, the Magistrate Judge did not abuse its discretion.

B.
Second, Mr. Cruz argues that the Magistrate Judge abused its discretion by denying his claim for costs other than attorney's fees. The pertinent language of the EAJA instructs that, "[e]xcept as otherwise specifically provided by statute, a judgment for costs ... may be awarded to the prevailing party in any civil action brought by or against the United States or any agency or any official of the United States acting in his or her official capacity in any court having jurisdiction of such action." 28 U.S.C. § 2412(a)(1) (2006).
Although we have not addressed the issue of a district court's discretion to award or deny costs under the EAJA, the decision of the Federal Circuit in Neal & Company, Inc., v. United States is instructive.[1] In Neal, the court noted that 28 U.S.C. § 2412(a)(1) "does not create a presumption in favor of an award of costs to the prevailing party." 121 F.3d 683, 687 (Fed.Cir.1997). Instead, broad discretion rests with the trial court in awarding costs. See id. We agree with the reasoning of the Federal Circuit in this regard. The plain language of the statute provides that costs "may be awarded." 28 U.S.C. § 2412(a)(1). Accordingly, it is appropriate for a district court to exercise discretion in awarding or denying costs depending *326 on the particular circumstances. In the case at hand, the Magistrate Judge considered all the facts and circumstances surrounding Mr. Cruz's claims. After careful deliberation, the Magistrate Judge declined to award costs. Given this reasoning, the Magistrate Judge did not abuse its discretion in denying Mr. Cruz's motion for costs.

IV.
For the foregoing reasons, we will affirm the orders of the Magistrate Judge.
NOTES
[1]  In Morgan, we briefly discussed a claim for costs under 28 U.S.C. § 2412(a)(1). 142 F.3d at 689-90. We declined to reach a decision on the merits of the claim, however, because the party asking for costs failed to properly appeal from the district court's decision not to award costs. See id.
