XML 38 R16.htm IDEA: XBRL DOCUMENT
v3.7.0.1

Investment Securities | 6 Months Ended | 12 Months Ended
--- | --- | ---
Jun. 30, 2017 | Dec. 31, 2016
Securities Financing Transactions Disclosures Abstract |  |
Investment Securities |
(2) | Investment Securities
Securities to be held for indefinite periods, but not intended to be held to maturity, are classified as available-for-sale and carried at fair value. Securities held for indefinite periods include securities that management intends to use as part of its asset and liability management strategy and that may be sold in response to liquidity needs, changes in interest rates, resultant prepayment risk, pledging requirements, and other factors related to effective portfolio management. Securities to be held to maturity are carried at amortized cost. Realized gains and losses on dispositions are based on the net proceeds and the amortized cost of the securities sold, using the specific identification method. Unrealized gains and losses on investment securities are based on the difference between the amortized cost and fair value of each security as of the respective reporting date. Unrealized gains and losses are credited or charged to other comprehensive income, whereas realized gains and losses flow through Mid Penn’s consolidated statements of income for the respective period. ASC Topic 320, Investments—Debt and Equity Securities, clarifies the interaction of the factors that should be considered when determining whether a debt security is other-than-temporarily impaired. For debt securities, management must assess, in addition to the credit condition of the underlying issuer, whether (a) it has the intent to sell the security and (b) it is more likely than not that it will be required to sell the security prior to its anticipated recovery. These steps are done before assessing whether the entity will recover the cost basis of the investment. In instances when a determination is made that other-than-temporary impairment exists but the investor does not intend to sell the debt security and it is not more likely than not that it will be required to sell the debt security prior to its anticipated recovery, this guidance changes the presentation and amount of the other-than-temporary impairment recognized in the income statement. The other-than-temporary impairment is separated into (a) the amount of the total other-than-temporary impairment related to a decrease in cash flows expected to be collected from the debt security (the credit loss) and (b) the amount of the total other-than-temporary impairment related to all other factors. The amount of the total other-than-temporary impairment related to the credit loss is recognized in earnings. The amount of the total other-than-temporary impairment related to all other factors is recognized in other comprehensive income. Mid Penn had no securities considered by management to be other-than-temporarily impaired as of June 30, 2017, December 31, 2016, or June 30, 2016, and did not record any securities impairment charges in the respective periods ended on these dates. Mid Penn does not consider the securities with unrealized losses on the respective dates to be other-than-temporarily impaired as the unrealized losses were deemed to relate to changes in interest rates, and not erosion of credit quality. The amortized cost, fair value, and unrealized gains and losses on investment securities at June 30, 2017 and December 31, 2016 are as follows:
(Dollars in thousands) |  | Amortized Cost |  |  | Unrealized Gains |  |  | Unrealized Losses |  |  | Fair Value |
June 30, 2017 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
Available-for-sale securities: |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
U.S. Treasury and U.S. government agencies |  | $ | 42,629 |  |  | $ | — |  |  | $ | 858 |  |  | $ | 41,771 |
Mortgage-backed U.S. government agencies |  |  | 28,543 |  |  |  | 3 |  |  |  | 307 |  |  |  | 28,239 |
State and political subdivision obligations |  |  | 39,539 |  |  |  | 70 |  |  |  | 514 |  |  |  | 39,095 |
Corporate debt securities |  |  | 1,100 |  |  |  | 5 |  |  |  | — |  |  |  | 1,105 |
Equity securities |  |  | 1,168 |  |  |  | 15 |  |  |  | 40 |  |  |  | 1,143 |
Total available-for-sale securities |  |  | 112,979 |  |  |  | 93 |  |  |  | 1,719 |  |  |  | 111,353 |
Held-to-maturity securities: |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
U.S. Treasury and U.S. government agencies |  |  | 10,984 |  |  |  | 24 |  |  |  | 5 |  |  |  | 11,003 |
Mortgage-backed U.S. government agencies |  |  | 51,248 |  |  |  | 72 |  |  |  | 99 |  |  |  | 51,221 |
State and political subdivision obligations |  |  | 8,864 |  |  |  | 120 |  |  |  | 9 |  |  |  | 8,975 |
Corporate debt securities |  |  | — |  |  |  | — |  |  |  | — |  |  |  | — |
Equity securities |  |  | — |  |  |  | — |  |  |  | — |  |  |  | — |
Total held-to-maturity securities |  |  | 71,096 |  |  |  | 216 |  |  |  | 113 |  |  |  | 71,199 |
Total |  | $ | 184,075 |  |  | $ | 309 |  |  | $ | 1,832 |  |  | $ | 182,552 |
(Dollars in thousands) |  | Amortized Cost |  |  | Unrealized Gains |  |  | Unrealized Losses |  |  | Fair Value |
December 31, 2016 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
Available-for-sale securities: |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
U.S. Treasury and U.S. government agencies |  | $ | 48,520 |  |  | $ | 34 |  |  | $ | 1,542 |  |  | $ | 47,012 |
Mortgage-backed U.S. government agencies |  |  | 26,181 |  |  |  | 17 |  |  |  | 579 |  |  |  | 25,619 |
State and political subdivision obligations |  |  | 61,079 |  |  |  | 91 |  |  |  | 2,332 |  |  |  | 58,838 |
Corporate debt securities |  |  | 1,100 |  |  |  | — |  |  |  | — |  |  |  | 1,100 |
Equity securities |  |  | 1,168 |  |  |  | — |  |  |  | 112 |  |  |  | 1,056 |
Total available-for-sale securities |  | $ | 138,048 |  |  | $ | 142 |  |  | $ | 4,565 |  |  | $ | 133,625 |
There were no held-to-maturity securities as of December 31, 2016. Estimated fair values of debt securities are based on quoted market prices, where applicable. If quoted market prices are not available, fair values are based on quoted market prices of comparable instruments, adjusted for differences between the quoted instruments and the instruments being valued. Please refer to Note (4)—Fair Value Measurement for more information on the fair value of investment securities. Investment securities having a fair value of $126,032,000 at June 30, 2017 and $131,469,000 at December 31, 2016, were pledged to secure public deposits and certain other borrowings. Mid Penn realized gross gains and losses of $77,000 and ($65,000), respectively, on sales of securities available for sale during the three months ended June 30, 2017, while gross gains and losses of $200,000 and ($180,000), respectively, were realized on sales of securities available for sale during the six months ended June 30, 2017. Mid Penn realized gross gains and losses of $450,000 and ($237,000), respectively, on sales of securities available for sale during the six months ended June 30, 2016. The following tables present gross unrealized losses and fair value of investments aggregated by investment category and length of time that individual securities have been in a continuous unrealized loss position at June 30, 2017 and December 31, 2016.
|  | Less Than 12 Months |  |  | 12 Months or More |  |  | Total |
(Dollars in thousands) |  | Number of Securities |  |  | Fair Value |  |  | Unrealized Losses |  |  | Number of Securities |  |  | Fair Value |  |  | Unrealized Losses |  |  | Number of Securities |  |  | Fair Value |  |  | Unrealized Losses |
June 30, 2017 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
Available-for-sale securities: |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
U.S. Treasury and U.S. government agencies |  |  | 21 |  |  | $ | 39,077 |  |  | $ | 852 |  |  |  | 1 |  |  | $ | 2,694 |  |  | $ | 6 |  |  |  | 22 |  |  | $ | 41,771 |  |  | $ | 858 |
Mortgage-backed U.S. government agencies |  |  | 18 |  |  |  | 26,466 |  |  |  | 291 |  |  |  | 1 |  |  |  | 535 |  |  |  | 16 |  |  |  | 19 |  |  |  | 27,001 |  |  |  | 307 |
State and political subdivision obligations |  |  | 48 |  |  |  | 24,121 |  |  |  | 381 |  |  |  | 7 |  |  |  | 3,845 |  |  |  | 133 |  |  |  | 55 |  |  |  | 27,966 |  |  |  | 514 |
Equity securities |  |  | 0 |  |  |  | — |  |  |  | — |  |  |  | 1 |  |  |  | 550 |  |  |  | 40 |  |  |  | 1 |  |  |  | 550 |  |  |  | 40 |
Total temporarily impaired available- for-sale securities |  |  | 87 |  |  |  | 89,664 |  |  |  | 1,524 |  |  |  | 10 |  |  |  | 7,624 |  |  |  | 195 |  |  |  | 97 |  |  |  | 97,288 |  |  |  | 1,719 |
Held-to-maturity securities: |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
U.S. Treasury and U.S. government agencies |  |  | 2 |  |  |  | 4,991 |  |  |  | 5 |  |  |  | 0 |  |  |  | — |  |  |  | — |  |  |  | 2 |  |  |  | 4,991 |  |  |  | 5 |
Mortgage-backed U.S. government agencies |  |  | 14 |  |  |  | 22,879 |  |  |  | 99 |  |  |  | 0 |  |  |  | — |  |  |  | — |  |  |  | 14 |  |  |  | 22,879 |  |  |  | 99 |
State and political subdivision obligations |  |  | 3 |  |  |  | 1,536 |  |  |  | 9 |  |  |  | 0 |  |  |  | — |  |  |  | — |  |  |  | 3 |  |  |  | 1,536 |  |  |  | 9 |
Total temporarily impaired held-to-maturity securities |  |  | 19 |  |  |  | 29,406 |  |  |  | 113 |  |  |  | 0 |  |  |  | — |  |  |  | — |  |  |  | 19 |  |  |  | 29,406 |  |  |  | 113 |
Total |  |  | 106 |  |  | $ | 119,070 |  |  | $ | 1,637 |  |  |  | 10 |  |  | $ | 7,624 |  |  | $ | 195 |  |  |  | 116 |  |  | $ | 126,694 |  |  | $ | 1,832 |
|  | Less Than 12 Months |  |  | 12 Months or More |  |  | Total |
(Dollars in thousands) |  | Number of Securities |  |  | Fair Value |  |  | Unrealized Losses |  |  | Number of Securities |  |  | Fair Value |  |  | Unrealized Losses |  |  | Number of Securities |  |  | Fair Value |  |  | Unrealized Losses |
December 31, 2016 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
Available-for-sale securities: |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
U.S. Treasury and U.S. government agencies |  |  | 23 |  |  | $ | 43,698 |  |  | $ | 1,542 |  |  |  | 0 |  |  | $ | — |  |  | $ | — |  |  |  | 23 |  |  | $ | 43,698 |  |  | $ | 1,542 |
Mortgage-backed U.S. government agencies |  |  | 18 |  |  |  | 24,321 |  |  |  | 579 |  |  |  | 0 |  |  |  | — |  |  |  | — |  |  |  | 18 |  |  |  | 24,321 |  |  |  | 579 |
State and political subdivision obligations |  |  | 108 |  |  |  | 50,582 |  |  |  | 2,332 |  |  |  | 0 |  |  |  | — |  |  |  | — |  |  |  | 108 |  |  |  | 50,582 |  |  |  | 2,332 |
Equity securities |  |  | 0 |  |  |  | — |  |  |  | — |  |  |  | 2 |  |  |  | 1,056 |  |  |  | 112 |  |  |  | 2 |  |  |  | 1,056 |  |  |  | 112 |
Total temporarily impaired available-for-sale securities |  |  | 149 |  |  | $ | 118,601 |  |  | $ | 4,453 |  |  |  | 2 |  |  | $ | 1,056 |  |  | $ | 112 |  |  |  | 151 |  |  | $ | 119,657 |  |  | $ | 4,565 |
There were no held-to-maturity securities as of December 31, 2016. Management evaluates securities for other-than-temporary impairment on at least a quarterly basis, and more frequently when economic or market concerns warrant such additional evaluation. Consideration is given to the length of time and the extent to which the fair value has been less than amortized cost and the financial condition and near term prospects of the issuer. In addition, for debt securities, Mid Penn considers (a) whether management has the intent to sell the security, (b) it is more likely than not that management will be required to sell the security prior to its anticipated recovery, and (c) whether management expects to recover the entire amortized cost basis. For equity securities, management considers the intent and ability to hold securities until recovery of unrealized losses. The majority of the investment portfolio is comprised of securities issued by U.S. government agencies and state and political subdivision obligations. For the investment securities with an unrealized loss, Mid Penn has concluded, based on its analysis, that the unrealized losses were primarily caused by the movement of interest rates and not due to an erosion of credit quality of the underlying issuers. At June 30, 2017, the majority of the unrealized losses on available-for-sale securities in an unrealized loss position were attributed to obligations of state and political subdivisions and U.S. Treasury and government agencies, while the majority of the unrealized losses on held-to-maturity securities in an unrealized loss position were attributed to mortgage-backed U.S. government agencies. At December 31, 2016, the majority of the unrealized losses on securities in an unrealized loss position were attributed to state and political subdivision obligations and U.S. Treasury and government agencies. The table below illustrates the maturity distribution of investment securities at amortized cost and fair value as of June 30, 2017.
|  | Available-for-sale |  |  | Held-to-maturity |
(Dollars in thousands) |  | Amortized Cost |  |  | Fair Value |  |  | Amortized Cost |  |  | Fair Value |
June 30, 2017 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
Due in 1 year or less |  | $ | 1,293 |  |  | $ | 1,292 |  |  | $ | — |  |  | $ | — |
Due after 1 year but within 5 years |  |  | 20,311 |  |  |  | 20,178 |  |  |  | 14,486 |  |  |  | 14,546 |
Due after 5 years but within 10 years |  |  | 47,618 |  |  |  | 46,801 |  |  |  | 5,362 |  |  |  | 5,432 |
Due after 10 years |  |  | 14,046 |  |  |  | 13,700 |  |  |  | — |  |  |  | — |
|  |  | 83,268 |  |  |  | 81,971 |  |  |  | 19,848 |  |  |  | 19,978 |
Mortgage-backed securities |  |  | 28,543 |  |  |  | 28,239 |  |  |  | 51,248 |  |  |  | 51,221 |
Equity securities |  |  | 1,168 |  |  |  | 1,143 |  |  |  | — |  |  |  | — |
|  | $ | 112,979 |  |  | $ | 111,353 |  |  | $ | 71,096 |  |  | $ | 71,199
(7) | Investment Securities
Securities to be held for indefinite periods, but not intended to be held to maturity, are classified as available for sale and carried at fair value. Securities held for indefinite periods include securities that management intends to use as part of its asset and liability management strategy and that may be sold in response to liquidity needs, changes in interest rates, resultant prepayment risk, and other factors related to interest rate and resultant prepayment risk changes. Realized gains and losses on dispositions are based on the net proceeds and the adjusted book value of the securities sold, using the specific identification method. Unrealized gains and losses on investment securities available for sale are based on the difference between book value and fair value of each security. These gains and losses are credited or charged to other comprehensive income (loss), whereas realized gains and losses flow through Mid Penn’s consolidated statements of income. ASC Topic 320, Investments – Debt and Equity Securities, clarifies the interaction of the factors that should be considered when determining whether a debt security is other-than-temporarily impaired. For debt securities, management must assess whether (a) it has the intent to sell the security and (b) it is more likely than not that it will be required to sell the security prior to its anticipated recovery. These steps are done before assessing whether the entity will recover the cost basis of the investment. In instances when a determination is made that other-than-temporary impairment exists but the investor does not intend to sell the debt security and it is not more likely than not that it will be required to sell the debt security prior to its anticipated recovery, this guidance changes the presentation and amount of the other-than-temporary impairment recognized in the income statement. The other-than-temporary impairment is separated into (a) the amount of the total other-than-temporary impairment related to a decrease in cash flows expected to be collected from the debt security (the credit loss) and (b) the amount of the total other-than-temporary impairment related to all other factors. The amount of the total other-than-temporary impairment related to the credit loss is recognized in earnings. The amount of the total other-than-temporary impairment related to all other factors is recognized in other comprehensive income (loss). In assessing potential other-than-temporary impairment for equity securities, consideration is given to management’s intent and ability to hold the securities until recovery of unrealized losses. Mid Penn had no other-than-temporary impaired debt or equity securities in 2016, 2015, and 2014. At December 31, 2016 and 2015, amortized cost, fair value, and unrealized gains and losses on investment securities are as follows:
(Dollars in thousands) |  | Amortized Cost |  |  | Unrealized Gains |  |  | Unrealized Losses |  |  | Fair Value |
December 31, 2016 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
Available for sale securities: |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
U.S. Treasury and U.S. government agencies |  | $ | 48,520 |  |  | $ | 34 |  |  | $ | 1,542 |  |  | $ | 47,012 |
Mortgage-backed U.S. government agencies |  |  | 26,181 |  |  |  | 17 |  |  |  | 579 |  |  |  | 25,619 |
State and political subdivision obligations |  |  | 61,079 |  |  |  | 91 |  |  |  | 2,332 |  |  |  | 58,838 |
Corporate debt securities |  |  | 1,000 |  |  |  | — |  |  |  | — |  |  |  | 1,000 |
Equity securities |  |  | 1,268 |  |  |  | — |  |  |  | 112 |  |  |  | 1,156 |
|  | $ | 138,048 |  |  | $ | 142 |  |  | $ | 4,565 |  |  | $ | 133,625 |
(Dollars in thousands) |  | Amortized Cost |  |  | Unrealized Gains |  |  | Unrealized Losses |  |  | Fair Value |
December 31, 2015 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
Available for sale securities: |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
U.S. Treasury and U.S. government agencies |  | $ | 26,316 |  |  | $ | 729 |  |  | $ | 55 |  |  | $ | 26,990 |
Mortgage-backed U.S. government agencies |  |  | 38,983 |  |  |  | 49 |  |  |  | 228 |  |  |  | 38,804 |
State and political subdivision obligations |  |  | 64,780 |  |  |  | 1,914 |  |  |  | 77 |  |  |  | 66,617 |
Corporate debt securities |  |  | 2,000 |  |  |  | 80 |  |  |  | 10 |  |  |  | 2,070 |
Equity securities |  |  | 1,271 |  |  |  | 2 |  |  |  | 33 |  |  |  | 1,240 |
|  | $ | 133,350 |  |  | $ | 2,774 |  |  | $ | 403 |  |  | $ | 135,721 |
Estimated fair values of debt securities are based on quoted market prices, where applicable. If quoted market prices are not available, fair values are based on quoted market prices of comparable instruments, adjusted for differences between the quoted instruments and the instruments being valued. Investment securities having a fair value of $131,469,000 at December 31, 2016, and $130,298,000 at December 31, 2015, were pledged primarily to secure public deposits. The following table presents gross unrealized losses and fair value of investments aggregated by investment category and length of time that individual securities have been in a continuous unrealized loss position at December 31, 2016 and 2015.
|  | Less Than 12 Months |  |  | 12 Months or More |  |  | Total |
(Dollars in thousands) December 31, 2016 |  | Number of Securities |  |  | Fair Value |  |  | Unrealized Losses |  |  | Number of Securities |  |  | Fair Value |  |  | Unrealized Losses |  |  | Number of Securities |  |  | Fair Value |  |  | Unrealized Losses |
Available for sale securities: |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
U.S. Treasury and U.S. government agencies |  |  | 23 |  |  | $ | 43,698 |  |  | $ | 1,542 |  |  |  | 0 |  |  | $ | — |  |  | $ | — |  |  |  | 23 |  |  | $ | 43,698 |  |  | $ | 1,542 |
Mortgage-backed U.S. government agencies |  |  | 18 |  |  |  | 24,321 |  |  |  | 579 |  |  |  | 0 |  |  |  | — |  |  |  | — |  |  |  | 18 |  |  |  | 24,321 |  |  |  | 579 |
State and political subdivision obligations |  |  | 108 |  |  |  | 50,582 |  |  |  | 2,332 |  |  |  | 0 |  |  |  | — |  |  |  | — |  |  |  | 108 |  |  |  | 50,582 |  |  |  | 2,332 |
Equity securities |  |  | 0 |  |  |  | — |  |  |  | — |  |  |  | 2 |  |  |  | 1,056 |  |  |  | 112 |  |  |  | 2 |  |  |  | 1,056 |  |  |  | 112 |
Total temporarily impaired available for sale securities |  |  | 149 |  |  | $ | 118,601 |  |  | $ | 4,453 |  |  |  | 2 |  |  | $ | 1,056 |  |  | $ | 112 |  |  |  | 151 |  |  | $ | 119,657 |  |  | $ | 4,565 |
|  | Less Than 12 Months |  |  | 12 Months or More |  |  | Total |
(Dollars in thousands) December 31, 2015 |  | Number of Securities |  |  | Fair Value |  |  | Unrealized Losses |  |  | Number of Securities |  |  | Fair Value |  |  | Unrealized Losses |  |  | Number of Securities |  |  | Fair Value |  |  | Unrealized Losses |
Available for sale securities: |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
U.S. Treasury and U.S. government agencies |  |  | 6 |  |  | $ | 6,259 |  |  | $ | 43 |  |  |  | 2 |  |  | $ | 1,383 |  |  | $ | 12 |  |  |  | 8 |  |  | $ | 7,642 |  |  | $ | 55 |
Mortgage-backed U.S. government agencies |  |  | 13 |  |  |  | 12,759 |  |  |  | 124 |  |  |  | 11 |  |  |  | 6,282 |  |  |  | 104 |  |  |  | 24 |  |  |  | 19,041 |  |  |  | 228 |
State and political subdivision obligations |  |  | 9 |  |  |  | 4,041 |  |  |  | 32 |  |  |  | 3 |  |  |  | 1,631 |  |  |  | 45 |  |  |  | 12 |  |  |  | 5,672 |  |  |  | 77 |
Corporate debt securities |  |  | 1 |  |  |  | 990 |  |  |  | 10 |  |  |  | 0 |  |  |  | — |  |  |  | — |  |  |  | 1 |  |  |  | 990 |  |  |  | 10 |
Equity securities |  |  | 0 |  |  |  | — |  |  |  | — |  |  |  | 2 |  |  |  | 615 |  |  |  | 33 |  |  |  | 2 |  |  |  | 615 |  |  |  | 33 |
Total temporarily impaired available for sale securities |  |  | 29 |  |  | $ | 24,049 |  |  | $ | 209 |  |  |  | 18 |  |  | $ | 9,911 |  |  | $ | 194 |  |  |  | 47 |  |  | $ | 33,960 |  |  | $ | 403 |
Management evaluates securities for other-than-temporary impairment on a quarterly basis; and more frequently when economic or market concerns warrant such evaluation. Consideration is given to the length of time and the extent to which the fair value has been less than cost, and the financial condition and near term prospects of the issuer. In addition, for debt securities, Mid Penn considers (a) whether management has the intent to sell the security, (b) it is more likely than not that management will be required to sell the security prior to its anticipated recovery, and (c) whether management expects to recover the entire amortized cost basis. For equity securities, management considers the intent and ability to hold securities until recovery of unrealized losses. The majority of the investment portfolio is comprised of mortgage-backed U.S. government agencies and state and political subdivision obligations. For the investment securities with an unrealized loss, Mid Penn has concluded, based on its analysis, that the unrealized losses in the investments are primarily caused by the movement of interest rates, and the contractual terms of these investments do not permit the issuer to settle the securities at a price less than the par value of the investment. At December 31, 2016, Mid Penn had 149 debt securities and 2 equity securities with unrealized losses totaling $4,565,000 that depreciated 3.82% from their collective amortized cost basis. At December 31, 2016, the majority of the unrealized losses on securities in an unrealized loss position were attributed to state and political subdivision obligations and U.S. Treasury and government agencies. At December 31, 2015, Mid Penn had 45 debt securities and 2 equity securities with unrealized losses totaling $403,000 that depreciated 1.19% from their amortized cost basis. At December 31, 2015, the majority of the unrealized losses on securities in an unrealized loss position were attributed to mortgage-backed U.S. government agencies. Because Mid Penn does not intend to sell these investments and it is not likely it will be required to sell these investments before a recovery of fair value, which may be maturity, Mid Penn does not consider the securities with unrealized losses to be other-than-temporarily impaired as losses relate to changes in interest rates and not erosion of credit quality. During 2016, Mid Penn realized gross gains on the sales of securities available for sale of $1,927,000 on 102 debt securities. Mid Penn also realized $881,000 in gross losses on the sales of 56 debt securities available for sale during 2016. Mid Penn realized gross gains of $325,000 and $168,000 on sales of securities available for sale during 2015 and 2014, respectively, while no gross losses were realized in 2015 and 2014. The table below is the maturity distribution of investment securities at amortized cost and fair value at December 31, 2016.
|  | December 31, 2016 |
(Dollars in thousands) |  | Amortized Cost |  |  | Fair Value |
Due in 1 year or less |  | $ | 1,293 |  |  | $ | 1,305 |
Due after 1 year but within 5 years |  |  | 19,656 |  |  |  | 19,471 |
Due after 5 years but within 10 years |  |  | 66,084 |  |  |  | 63,895 |
Due after 10 years |  |  | 23,566 |  |  |  | 22,179 |
|  |  | 110,599 |  |  |  | 106,850 |
Mortgage-backed securities |  |  | 26,181 |  |  |  | 25,619 |
Equity securities |  |  | 1,268 |  |  |  | 1,156 |
|  | $ | 138,048 |  |  | $ | 133,625

X
- Definition The entire disclosure for investments in certain debt and equity securities. + References Reference 1: http://www.xbrl.org/2003/role/presentationRef -Publisher FASB -Name Accounting Standards Codification -Topic 320 -URI http://asc.fasb.org/topic&trid=2196928 Reference 2: http://www.xbrl.org/2003/role/presentationRef -Publisher FASB -Name Accounting Standards Codification -Topic 944 -SubTopic 320 -URI http://asc.fasb.org/subtopic&trid=4738149 Reference 3: http://www.xbrl.org/2003/role/presentationRef -Publisher FASB -Name Accounting Standards Codification -Topic 940 -SubTopic 320 -URI http://asc.fasb.org/subtopic&trid=2176304 Reference 4: http://www.xbrl.org/2003/role/presentationRef -Publisher FASB -Name Accounting Standards Codification -Topic 946 -SubTopic 320 -URI http://asc.fasb.org/subtopic&trid=2324412 Reference 5: http://www.xbrl.org/2003/role/presentationRef -Publisher FASB -Name Accounting Standards Codification -Topic 942 -SubTopic 320 -URI http://asc.fasb.org/subtopic&trid=2209399 Reference 6: http://www.xbrl.org/2003/role/presentationRef -Publisher FASB -Name Accounting Standards Codification -Topic 954 -SubTopic 320 -URI http://asc.fasb.org/subtopic&trid=2289146 + Details
Name: | us-gaap_InvestmentsInDebtAndMarketableEquitySecuritiesAndCertainTradingAssetsDisclosureTextBlock
Namespace Prefix: | us-gaap_
Data Type: | nonnum:textBlockItemType
Balance Type: | na
Period Type: | duration

X
- References No definition available. + Details
Name: | us-gaap_SecuritiesFinancingTransactionsDisclosuresAbstract
Namespace Prefix: | us-gaap_
Data Type: | xbrli:stringItemType
Balance Type: | na
Period Type: | duration