A repurchase agreement is the sale of a security coupled with a promise to buy back the security at a specific price and date in the future. It is called a repurchase agreement but it is actually a loan. The seller receives cash for the security sold. The buyer of the security is loaning cash to the seller, and holding the security as collateral. The seller agrees to buy back the security at a higher price after a certain amount of time has elapsed. By repurchasing the security at a higher price in the future, the seller is in effect paying interest on funds borrowed from the buyer. Typically, the selling price is set equal to the repurchase price plus a   negotiated amount of interest. If the borrower fails to repurchase the security at the agreed on date in the future, the lender can sell the security to a third party and recoup the funds lent. If the lender fails to resell the security to the previous owner, the previous owner can use the funds for repurchasing the security to purchase another investment.

Repurchase agreements have long played a role in the U.S. monetary system. As early as 1917, Federal Reserve Banks used repurchase agreements to extend credit to commercial banks. During the 1920s the New York Federal Reserve used repurchase agreements to extend credit to nonbank dealers in short-term credit instruments.

As U.S. inflation led to higher interest rates in the post–World War II era, repurchasing agreements grew in popularity. Nonbank dealers in treasury bonds went searching for less costly financing than what commercial banks, their traditional sources of credit, were offering. At the same time, large state and local governments and nonfinancial corporations discovered that, despite rising interest rates, bank deposits paid zero interest. By being party to a repurchase agreement these institutions could earn interest on funds idly sitting in interest-free bank accounts. Purchasing a treasury bond under a repurchase agreement involved minimal risk, negotiable maturities, and routine mechanics. Treasury bond dealers and institutional cash managers created a
market for repurchase agreements. After the 1970s the growth in U.S. Treasury marketable debt and rising
short-term interest rates made repurchase agreements attractive to all kinds of creditors, including school districts and other small creditors that could not earn interest on checking accounts (Garbade, 2006).  Bepurchase agreements became a common vehicle for the short-term investment of surplus cash. Congress lifted the ban on interest-bearing checking accounts in 1980. 

The securities most often involved in repurchase agreements are U.S. Treasury and federal agency bonds, but repurchase agreements can be arranged for mortgage-backed securities, and various short-term money market credit instruments, including negotiable bank certificates of deposit.

Repurchase agreements are nearly all short-term agreements. Overnight repurchase agreements are the most common type of treasury bond repurchase agreement. Other standard maturities for repurchase agreements include one, two and three weeks, and one, two, three, and six months. The parties to the repurchase 
agreement may negotiate flexible terms to maturity.

The purchaser of a security in a repurchase agreement only earns the interest that is agreed on in the contract.
A treasury bond in a repurchase agreement will usually remain registered in the name of the seller. The seller in the repurchase agreement will directly receive any coupon payments earned by the bond while the buyer is
holding it. 

U.S. commercial banks regard repurchase agreements as a close substitute for Federal funds borrowing. The interest rate commercial banks pay on repurchase agreements is usually 25 to 30 basis points below the Federal funds rate (Lumpkin, 1987). The interest rates on repurchase agreements are a bit lower because repurchase agreements are backed by high-quality collateral. Rather than borrow funds in the Federal funds
market, a commercial bank may arrange an overnight repurchase agreement with one of its large depositors. Some countries include the repurchase liabilities of depository institutions in the broader measurers of the circulating money stock. The Federal Reserve Bank of New York also arranges repurchase agreements
with primary dealers in treasury securities as a part of its open market operations. 

Garbade, Kenneth D. “The Evolution of Repo Contracting Conventions in the 1980’s.” Economic Policy Review-Federal Reserve Bank of New York, vol. 12, no. 1 (May 2006): 27–44.
Lumpkin, Stephen. “Repurchase and Reverse Repurchase Agreements.” Economic Review, Federal Reserve Bank of Richmond, vol. 731 (January 1987): 15–23.